The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
wb::side_actions Class Reference

This internal whiteboard class holds the planned action queues for a team, and offers many utility methods to create and manipulate them. More...

#include <side_actions.hpp>

Inheritance diagram for wb::side_actions:
Inheritance graph

Classes

struct  numbers_t
 

Public Types

typedef side_actions_container container
 
typedef container::iterator iterator
 
typedef container::const_iterator const_iterator
 
typedef container::reverse_iterator reverse_iterator
 
typedef
container::const_reverse_iterator 
const_reverse_iterator
 
typedef std::pair< iterator,
iterator
range_t
 
typedef std::pair
< reverse_iterator,
reverse_iterator
rrange_t
 
typedef std::pair
< const_iterator,
const_iterator
crange_t
 
typedef std::pair
< const_reverse_iterator,
const_reverse_iterator
crrange_t
 
typedef config net_cmd
 Network code. More...
 

Public Member Functions

 side_actions ()
 
void set_team_index (size_t team_index)
 Must be called only once, right after the team that owns this side_actions is added to the teams vector. More...
 
size_t team_index ()
 Returns the team index this action queue belongs to. More...
 
void get_numbers (const map_location &hex, numbers_t &result)
 Gets called when display is drawing a hex to determine which numbers to draw on it. More...
 
bool execute_next ()
 Executes the first action in the queue, and then deletes it. More...
 
bool execute (iterator position)
 Executes the specified action, if it exists in the queue. More...
 
bool empty () const
 Indicates whether the action queue is empty. More...
 
size_t size () const
 Returns the number of actions in the action queue. More...
 
size_t num_turns () const
 Returns the number of turns that have plans. More...
 
size_t turn_size (size_t turn_num) const
 Returns the number of actions planned for turn turn_num. More...
 
size_t get_turn (const_iterator it) const
 Returns the turn of a given iterator planned execution. More...
 
void clear ()
 Empties the action queue. More...
 
void hide ()
 Sets whether or not the contents should be drawn on the screen. More...
 
void show ()
 
bool hidden () const
 
iterator insert_action (iterator position, action_ptr action)
 Inserts an action at the specified position. More...
 
iterator queue_action (size_t turn_num, action_ptr action)
 Queues an action to be executed last. More...
 
iterator bump_earlier (iterator position)
 Moves an action earlier in the execution order. More...
 
iterator bump_later (iterator position)
 Moves an action later in the execution order. More...
 
iterator remove_action (iterator position, bool validate_after_delete=true)
 Deletes the action at the specified position. More...
 
iterator get_position_of (action_ptr action)
 
iterator begin ()
 Returns the iterator for the first (executed earlier) action within the actions queue. More...
 
reverse_iterator rbegin ()
 reverse version of the above More...
 
const_iterator begin () const
 const versions of the above More...
 
const_reverse_iterator rbegin () const
 
iterator end ()
 Returns the iterator for the position after the last executed action within the actions queue. More...
 
reverse_iterator rend ()
 reverse version of the above More...
 
const_iterator end () const
 const versions of the above More...
 
const_reverse_iterator rend () const
 
iterator turn_begin (size_t turn_num)
 
iterator turn_end (size_t turn_num)
 
reverse_iterator turn_rbegin (size_t turn_num)
 
reverse_iterator turn_rend (size_t turn_num)
 
const_iterator turn_begin (size_t turn_num) const
 
const_iterator turn_end (size_t turn_num) const
 
const_reverse_iterator turn_rbegin (size_t turn_num) const
 
const_reverse_iterator turn_rend (size_t turn_num) const
 
range_t iter_turn (size_t turn_num)
 Returns an iterator range corresponding to the requested turn. More...
 
rrange_t riter_turn (size_t turn_num)
 
crange_t iter_turn (size_t turn_num) const
 
crrange_t riter_turn (size_t turn_num) const
 
template<typename T , typename Compare >
iterator find_first_action_of (std::pair< T, T > between, iterator limit, Compare comp)
 Find the (chronologically) first action between the iterators between.first and between.second but after or equals to limit with respect to the predicate comp. More...
 
template<typename T , typename Compare >
const_iterator find_first_action_of (std::pair< T, T > between, const_iterator limit, Compare comp) const
 
iterator find_first_action_at (map_location hex)
 Find the first action occurring at a given hex. More...
 
iterator find_first_action_of (unit const &unit, iterator start_position)
 Finds the first action that belongs to this unit, starting the search at the specified position. More...
 
iterator find_first_action_of (unit const &unit)
 Variant of this method that always start searching at the beginning of the queue. More...
 
iterator find_last_action_of (unit const &unit, iterator start_position)
 Finds the last action that belongs to this unit, starting the search backwards from the specified position. More...
 
const_iterator find_last_action_of (unit const &unit, const_iterator start_position) const
 const variant of the previous function More...
 
iterator find_last_action_of (unit const &unit)
 Variant of the previous method that always start searching at the end of the queue. More...
 
const_iterator find_last_action_of (unit const &unit) const
 const variant of the previous function More...
 
bool unit_has_actions (unit const &unit)
 
size_t count_actions_of (unit const &unit)
 
std::deque< action_ptractions_of (unit const &unit)
 
size_t get_turn_num_of (unit const &) const
 Determines the appropriate turn number for the next action planned for this unit. More...
 
int get_gold_spent () const
 Used to track gold spending by recruits/recalls when building the future unit map. More...
 
void change_gold_spent_by (int difference)
 Used to track gold spending by recruits/recalls when building the future unit map. More...
 
void reset_gold_spent ()
 Set gold spent back to zero. More...
 
void raw_turn_shift ()
 
void synced_turn_shift ()
 
iterator queue_move (size_t turn_num, unit &mover, const pathfind::marked_route &route, arrow_ptr arrow, fake_unit_ptr fake_unit)
 Queues a move to be executed last. More...
 
iterator queue_attack (size_t turn_num, unit &mover, const map_location &target_hex, int weapon_choice, const pathfind::marked_route &route, arrow_ptr arrow, fake_unit_ptr fake_unit)
 Queues an attack or attack-move to be executed last. More...
 
iterator queue_recruit (size_t turn_num, const std::string &unit_name, const map_location &recruit_hex)
 Queues a recruit to be executed last. More...
 
iterator queue_recall (size_t turn_num, const unit &unit, const map_location &recall_hex)
 Queues a recall to be executed last. More...
 
iterator queue_suppose_dead (size_t turn_num, unit &curr_unit, map_location const &loc)
 Queues a suppose_dead to be executed last. More...
 
void execute_net_cmd (net_cmd const &)
 
net_cmd make_net_cmd_insert (size_t turn_num, size_t pos, action_const_ptr) const
 
net_cmd make_net_cmd_insert (const_iterator const &pos, action_const_ptr) const
 
net_cmd make_net_cmd_replace (const_iterator const &pos, action_const_ptr) const
 
net_cmd make_net_cmd_remove (const_iterator const &pos) const
 
net_cmd make_net_cmd_bump_later (const_iterator const &pos) const
 
net_cmd make_net_cmd_clear () const
 
net_cmd make_net_cmd_refresh () const
 

Private Member Functions

iterator safe_insert (size_t turn_num, size_t pos, action_ptr to_insert)
 
iterator synced_erase (iterator itor)
 
iterator synced_insert (iterator itor, action_ptr to_insert)
 
iterator synced_enqueue (size_t turn_num, action_ptr to_insert)
 
iterator safe_erase (iterator const &itor)
 

Private Attributes

container actions_
 
size_t team_index_
 
bool team_index_defined_
 
int gold_spent_
 Used to store gold "spent" in planned recruits/recalls when the future unit map is applied. More...
 
bool hidden_
 

Detailed Description

This internal whiteboard class holds the planned action queues for a team, and offers many utility methods to create and manipulate them.

It also provides an interface to the underlying side_actions_container.

Definition at line 281 of file side_actions.hpp.

Member Typedef Documentation

Definition at line 287 of file side_actions.hpp.

Definition at line 289 of file side_actions.hpp.

Definition at line 284 of file side_actions.hpp.

Definition at line 293 of file side_actions.hpp.

Definition at line 294 of file side_actions.hpp.

Definition at line 286 of file side_actions.hpp.

Network code.

A net_cmd object (a config in disguise) represents a modification to a side_actions object. execute_net_cmd() translates one of these into a real modification of *this. The make_net_cmd_***() family of functions is convenient for building specific types of net_cmds.

Definition at line 545 of file side_actions.hpp.

Definition at line 291 of file side_actions.hpp.

Definition at line 288 of file side_actions.hpp.

Definition at line 292 of file side_actions.hpp.

Constructor & Destructor Documentation

wb::side_actions::side_actions ( )

Definition at line 250 of file side_actions.cpp.

Member Function Documentation

std::deque< action_ptr > wb::side_actions::actions_of ( unit const &  unit)
iterator wb::side_actions::begin ( )
inline

Returns the iterator for the first (executed earlier) action within the actions queue.

Definition at line 405 of file side_actions.hpp.

References actions_, and wb::side_actions_container::begin().

Referenced by execute_next(), find_first_action_at(), find_first_action_of(), get_numbers(), get_position_of(), wb::highlighter::last_action_redraw(), make_net_cmd_insert(), make_net_cmd_refresh(), and raw_turn_shift().

const_iterator wb::side_actions::begin ( ) const
inline

const versions of the above

Definition at line 409 of file side_actions.hpp.

References actions_, and wb::side_actions_container::begin().

side_actions::iterator wb::side_actions::bump_earlier ( side_actions::iterator  position)

Moves an action earlier in the execution order.

i.e. at the front of the queue by one position.

Returns
The action's new position.

Definition at line 473 of file side_actions.cpp.

References actions_, wb::side_actions_container::bump_earlier(), check(), end(), ERR_WB, get_turn(), LOG_WB, make_net_cmd_bump_later(), wb::side_actions_container::position_in_turn(), team_index_, turn_size(), and resources::whiteboard.

Referenced by bump_later().

side_actions::iterator wb::side_actions::bump_later ( side_actions::iterator  position)

Moves an action later in the execution order.

i.e. at the back of the queue by one position.

Returns
The action's new position.

Definition at line 522 of file side_actions.cpp.

References bump_earlier(), and end().

Referenced by execute_net_cmd().

void wb::side_actions::change_gold_spent_by ( int  difference)

Used to track gold spending by recruits/recalls when building the future unit map.

Definition at line 613 of file side_actions.cpp.

References DBG_WB, gold_spent_, and team_index().

void wb::side_actions::clear ( )
inline

Empties the action queue.

Definition at line 357 of file side_actions.hpp.

References actions_, and wb::side_actions_container::clear().

Referenced by execute_net_cmd(), and wb::manager::on_change_controller().

size_t wb::side_actions::count_actions_of ( unit const &  unit)
bool wb::side_actions::empty ( ) const
inline

Indicates whether the action queue is empty.

Definition at line 326 of file side_actions.hpp.

References actions_, and wb::side_actions_container::empty().

Referenced by execute_next(), get_numbers(), and wb::operator<<().

iterator wb::side_actions::end ( )
inline
const_iterator wb::side_actions::end ( ) const
inline

const versions of the above

Definition at line 419 of file side_actions.hpp.

References actions_, and wb::side_actions_container::end().

bool wb::side_actions::execute ( side_actions::iterator  position)

Executes the specified action, if it exists in the queue.

If the action is not finished, it's moved at the end of the queue.

Returns
true if the action was completed successfully

Definition at line 310 of file side_actions.cpp.

References actions_, actions::undo_list::clear(), wb::side_actions_container::empty(), wb::side_actions_container::end(), ERR_WB, LOG_WB, make_net_cmd_replace(), synced_erase(), team_index_, turn_end(), resources::undo_stack, and resources::whiteboard.

Referenced by execute_next().

void wb::side_actions::execute_net_cmd ( net_cmd const &  cmd)
bool wb::side_actions::execute_next ( )

Executes the first action in the queue, and then deletes it.

Returns
true if the action was completed successfully

Definition at line 301 of file side_actions.cpp.

References begin(), empty(), and execute().

side_actions::iterator wb::side_actions::find_first_action_at ( map_location  hex)

Find the first action occurring at a given hex.

Return values
end()if no action occurs at the given location.

Definition at line 556 of file side_actions.cpp.

References actions_, begin(), find_first_action_of(), and wb::side_actions_container::get().

Referenced by wb::find_action_at().

template<typename T , typename Compare >
side_actions::iterator wb::side_actions::find_first_action_of ( std::pair< T, T >  between,
iterator  limit,
Compare  comp 
)

Find the (chronologically) first action between the iterators between.first and between.second but after or equals to limit with respect to the predicate comp.

This function makes sense when T is a non-chronological iterator. If T is iterator and Compare is std::less<iterator>, this function returns limit if limit is in [between.first, between.second) or between.first if between.first>limit or end() otherwise.

Parameters
betweenthe two iterators between which the action will be searched.
limitthe lower bound to search from, that is the return value `it' will verify !comp(limit, it).
compthe predicate to compare with.
Returns
`it' so that for all values `x' in [between.first, between.second), chronologically, !comp(x, it) and !comp(it, limit).
Return values
end()if no such action exist.

Definition at line 592 of file side_actions.hpp.

References actions_, wb::side_actions_container::end(), and wb::side_actions_container::project().

Referenced by find_first_action_at(), find_first_action_of(), and find_last_action_of().

template<typename T , typename Compare >
side_actions::const_iterator wb::side_actions::find_first_action_of ( std::pair< T, T >  between,
const_iterator  limit,
Compare  comp 
) const
side_actions::iterator wb::side_actions::find_first_action_of ( unit const &  unit,
side_actions::iterator  start_position 
)

Finds the first action that belongs to this unit, starting the search at the specified position.

Returns
The position, or end() if not found.

Definition at line 561 of file side_actions.cpp.

References actions_, find_first_action_of(), wb::side_actions_container::get(), and unit::underlying_id().

iterator wb::side_actions::find_first_action_of ( unit const &  unit)
inline

Variant of this method that always start searching at the beginning of the queue.

Definition at line 470 of file side_actions.hpp.

References begin(), and find_first_action_of().

Referenced by find_first_action_of().

side_actions::iterator wb::side_actions::find_last_action_of ( unit const &  unit,
side_actions::iterator  start_position 
)

Finds the last action that belongs to this unit, starting the search backwards from the specified position.

Returns
The position, or end() if not found.

Definition at line 570 of file side_actions.cpp.

References actions_, find_first_action_of(), wb::side_actions_container::get(), and unit::underlying_id().

Referenced by find_last_action_of(), get_turn_num_of(), and wb::highlighter::last_action_redraw().

side_actions::const_iterator wb::side_actions::find_last_action_of ( unit const &  unit,
side_actions::const_iterator  start_position 
) const

const variant of the previous function

Definition at line 566 of file side_actions.cpp.

References actions_, find_first_action_of(), wb::side_actions_container::get(), and unit::underlying_id().

side_actions::iterator wb::side_actions::find_last_action_of ( unit const &  unit)

Variant of the previous method that always start searching at the end of the queue.

Definition at line 580 of file side_actions.cpp.

References end(), and find_last_action_of().

side_actions::const_iterator wb::side_actions::find_last_action_of ( unit const &  unit) const

const variant of the previous function

Definition at line 575 of file side_actions.cpp.

References end(), and find_last_action_of().

int wb::side_actions::get_gold_spent ( ) const
inline

Used to track gold spending by recruits/recalls when building the future unit map.

Definition at line 498 of file side_actions.hpp.

References gold_spent_.

void wb::side_actions::get_numbers ( const map_location hex,
numbers_t result 
)
iterator wb::side_actions::get_position_of ( action_ptr  action)
inline
Parameters
actionThe action whose position you're looking for
Returns
The action's position within the queue, or end() if action wasn't found.

Definition at line 400 of file side_actions.hpp.

References begin(), end(), and gui2::event::find().

size_t wb::side_actions::get_turn ( const_iterator  it) const
inline

Returns the turn of a given iterator planned execution.

The value returned is the difference between the planned turn and the current turn.

Return values
0If the action is planned for the current turn.

Definition at line 352 of file side_actions.hpp.

References actions_, and wb::side_actions_container::get_turn().

Referenced by bump_earlier(), execute_net_cmd(), wb::find_action_at(), get_turn_num_of(), insert_action(), make_net_cmd_bump_later(), make_net_cmd_insert(), make_net_cmd_refresh(), make_net_cmd_remove(), make_net_cmd_replace(), raw_turn_shift(), and remove_action().

size_t wb::side_actions::get_turn_num_of ( unit const &  u) const

Determines the appropriate turn number for the next action planned for this unit.

Warning
A return value of 0 can mean that the unit has one action planned on turn 0 or that the unit doesn't have any action planned on any turn.
Return values
0if the unit doesn't have any planned action

Definition at line 604 of file side_actions.cpp.

References end(), find_last_action_of(), get_turn(), and itor.

Referenced by wb::manager::save_recruit(), wb::manager::save_suppose_dead(), wb::manager::save_temp_attack(), and wb::manager::save_temp_move().

bool wb::side_actions::hidden ( ) const
inline

Definition at line 362 of file side_actions.hpp.

References hidden_.

Referenced by wb::manager::draw_hex().

void wb::side_actions::hide ( )

Sets whether or not the contents should be drawn on the screen.

Definition at line 370 of file side_actions.cpp.

References hidden_.

side_actions::iterator wb::side_actions::insert_action ( iterator  position,
action_ptr  action 
)

Inserts an action at the specified position.

The begin() and end() functions might prove useful here.

Returns
The inserted action's position.

Definition at line 395 of file side_actions.cpp.

References actions_, ERR_WB, get_turn(), LOG_WB, wb::side_actions_container::position_in_turn(), synced_insert(), and resources::whiteboard.

range_t wb::side_actions::iter_turn ( size_t  turn_num)
inline

Returns an iterator range corresponding to the requested turn.

Definition at line 432 of file side_actions.hpp.

References actions_, and wb::side_actions_container::iter_turn().

Referenced by raw_turn_shift().

crange_t wb::side_actions::iter_turn ( size_t  turn_num) const
inline

Definition at line 434 of file side_actions.hpp.

References actions_, and wb::side_actions_container::iter_turn().

side_actions::net_cmd wb::side_actions::make_net_cmd_bump_later ( const_iterator const &  pos) const

Definition at line 833 of file side_actions.cpp.

References actions_, get_turn(), and wb::side_actions_container::position_in_turn().

Referenced by bump_earlier().

side_actions::net_cmd wb::side_actions::make_net_cmd_clear ( ) const

Definition at line 841 of file side_actions.cpp.

Referenced by wb::manager::on_change_controller().

side_actions::net_cmd wb::side_actions::make_net_cmd_insert ( size_t  turn_num,
size_t  pos,
action_const_ptr  act 
) const
side_actions::net_cmd wb::side_actions::make_net_cmd_insert ( const_iterator const &  pos,
action_const_ptr  act 
) const
side_actions::net_cmd wb::side_actions::make_net_cmd_refresh ( ) const
side_actions::net_cmd wb::side_actions::make_net_cmd_remove ( const_iterator const &  pos) const

Definition at line 825 of file side_actions.cpp.

References actions_, get_turn(), and wb::side_actions_container::position_in_turn().

Referenced by synced_erase().

side_actions::net_cmd wb::side_actions::make_net_cmd_replace ( const_iterator const &  pos,
action_const_ptr  act 
) const
size_t wb::side_actions::num_turns ( ) const
inline

Returns the number of turns that have plans.

If the container holds only one action on turn 1 (that is turn 0 is empty), this function will still returns 2. Indeed, turn 0 has an "empty" plan.

Note
The current turn is counted. That is if num_turns()==0 then empty()==true.

Definition at line 340 of file side_actions.hpp.

References actions_, and wb::side_actions_container::num_turns().

Referenced by wb::mapbuilder::build_map(), wb::for_each_action(), wb::operator<<(), and wb::manager::save_recall().

side_actions::iterator wb::side_actions::queue_action ( size_t  turn_num,
action_ptr  action 
)

Queues an action to be executed last.

Returns
The queued action's position

Definition at line 407 of file side_actions.cpp.

References ERR_WB, LOG_WB, synced_enqueue(), and resources::whiteboard.

Referenced by queue_attack(), queue_move(), queue_recall(), queue_recruit(), and queue_suppose_dead().

side_actions::iterator wb::side_actions::queue_attack ( size_t  turn_num,
unit mover,
const map_location target_hex,
int  weapon_choice,
const pathfind::marked_route route,
arrow_ptr  arrow,
fake_unit_ptr  fake_unit 
)

Queues an attack or attack-move to be executed last.

Returns
The queued attack's position

Definition at line 674 of file side_actions.cpp.

References hidden_, queue_action(), and team_index().

Referenced by wb::manager::save_temp_attack().

side_actions::iterator wb::side_actions::queue_move ( size_t  turn_num,
unit mover,
const pathfind::marked_route route,
arrow_ptr  arrow,
fake_unit_ptr  fake_unit 
)

Queues a move to be executed last.

Returns
The queued move's position

Definition at line 668 of file side_actions.cpp.

References hidden_, queue_action(), and team_index().

Referenced by wb::manager::save_temp_move().

side_actions::iterator wb::side_actions::queue_recall ( size_t  turn_num,
const unit unit,
const map_location recall_hex 
)

Queues a recall to be executed last.

Returns
The queued recall's position

Definition at line 686 of file side_actions.cpp.

References hidden_, queue_action(), and team_index().

Referenced by wb::manager::save_recall().

side_actions::iterator wb::side_actions::queue_recruit ( size_t  turn_num,
const std::string unit_name,
const map_location recruit_hex 
)

Queues a recruit to be executed last.

Returns
The queued recruit's position

Definition at line 680 of file side_actions.cpp.

References hidden_, queue_action(), and team_index().

Referenced by wb::manager::save_recruit().

side_actions::iterator wb::side_actions::queue_suppose_dead ( size_t  turn_num,
unit curr_unit,
map_location const &  loc 
)

Queues a suppose_dead to be executed last.

Returns
The queued suppose_dead's position (an iterator to it)

Definition at line 692 of file side_actions.cpp.

References hidden_, queue_action(), and team_index().

Referenced by wb::manager::save_suppose_dead().

void wb::side_actions::raw_turn_shift ( )
reverse_iterator wb::side_actions::rbegin ( )
inline

reverse version of the above

Definition at line 407 of file side_actions.hpp.

References actions_, and wb::side_actions_container::rbegin().

const_reverse_iterator wb::side_actions::rbegin ( ) const
inline

Definition at line 410 of file side_actions.hpp.

References actions_, and wb::side_actions_container::rbegin().

side_actions::iterator wb::side_actions::remove_action ( side_actions::iterator  position,
bool  validate_after_delete = true 
)

Deletes the action at the specified position.

Returns
The position of the element after the one deleted, or end() if the queue is empty.

Definition at line 537 of file side_actions.cpp.

References actions_, end(), ERR_WB, get_turn(), LOG_WB, wb::side_actions_container::position_in_turn(), synced_erase(), and resources::whiteboard.

Referenced by wb::mapbuilder::process().

reverse_iterator wb::side_actions::rend ( )
inline

reverse version of the above

Definition at line 417 of file side_actions.hpp.

References actions_, and wb::side_actions_container::rend().

const_reverse_iterator wb::side_actions::rend ( ) const
inline

Definition at line 420 of file side_actions.hpp.

References actions_, and wb::side_actions_container::rend().

void wb::side_actions::reset_gold_spent ( )

Set gold spent back to zero.

Definition at line 620 of file side_actions.cpp.

References DBG_WB, gold_spent_, and team_index().

rrange_t wb::side_actions::riter_turn ( size_t  turn_num)
inline

Definition at line 433 of file side_actions.hpp.

References actions_, and wb::side_actions_container::riter_turn().

crrange_t wb::side_actions::riter_turn ( size_t  turn_num) const
inline

Definition at line 435 of file side_actions.hpp.

References actions_, and wb::side_actions_container::riter_turn().

side_actions::iterator wb::side_actions::safe_erase ( iterator const &  itor)
private
side_actions::iterator wb::side_actions::safe_insert ( size_t  turn_num,
size_t  pos,
action_ptr  to_insert 
)
private
void wb::side_actions::set_team_index ( size_t  team_index)

Must be called only once, right after the team that owns this side_actions is added to the teams vector.

Definition at line 259 of file side_actions.cpp.

References team_index(), team_index_, and team_index_defined_.

void wb::side_actions::show ( )

Definition at line 382 of file side_actions.cpp.

References hidden_.

size_t wb::side_actions::size ( ) const
inline

Returns the number of actions in the action queue.

Definition at line 331 of file side_actions.hpp.

References actions_, and wb::side_actions_container::size().

side_actions::iterator wb::side_actions::synced_enqueue ( size_t  turn_num,
action_ptr  to_insert 
)
private
side_actions::iterator wb::side_actions::synced_erase ( iterator  itor)
private

Definition at line 636 of file side_actions.cpp.

References make_net_cmd_remove(), safe_erase(), team_index_, and resources::whiteboard.

Referenced by execute(), and remove_action().

side_actions::iterator wb::side_actions::synced_insert ( iterator  itor,
action_ptr  to_insert 
)
private
void wb::side_actions::synced_turn_shift ( )
size_t wb::side_actions::team_index ( )
inline
iterator wb::side_actions::turn_begin ( size_t  turn_num)
inline
const_iterator wb::side_actions::turn_begin ( size_t  turn_num) const
inline

Definition at line 426 of file side_actions.hpp.

References actions_, and wb::side_actions_container::turn_begin().

iterator wb::side_actions::turn_end ( size_t  turn_num)
inline
const_iterator wb::side_actions::turn_end ( size_t  turn_num) const
inline

Definition at line 427 of file side_actions.hpp.

References actions_, and wb::side_actions_container::turn_end().

reverse_iterator wb::side_actions::turn_rbegin ( size_t  turn_num)
inline

Definition at line 424 of file side_actions.hpp.

References actions_, and wb::side_actions_container::turn_rbegin().

const_reverse_iterator wb::side_actions::turn_rbegin ( size_t  turn_num) const
inline

Definition at line 428 of file side_actions.hpp.

References actions_, and wb::side_actions_container::turn_rbegin().

reverse_iterator wb::side_actions::turn_rend ( size_t  turn_num)
inline

Definition at line 425 of file side_actions.hpp.

References actions_, and wb::side_actions_container::turn_rend().

const_reverse_iterator wb::side_actions::turn_rend ( size_t  turn_num) const
inline

Definition at line 429 of file side_actions.hpp.

References actions_, and wb::side_actions_container::turn_rend().

size_t wb::side_actions::turn_size ( size_t  turn_num) const
inline

Returns the number of actions planned for turn turn_num.

Definition at line 343 of file side_actions.hpp.

References actions_, and wb::side_actions_container::turn_size().

Referenced by bump_earlier(), wb::operator<<(), and synced_enqueue().

bool wb::side_actions::unit_has_actions ( unit const &  unit)

Member Data Documentation

container wb::side_actions::actions_
private
int wb::side_actions::gold_spent_
private

Used to store gold "spent" in planned recruits/recalls when the future unit map is applied.

Definition at line 568 of file side_actions.hpp.

Referenced by change_gold_spent_by(), get_gold_spent(), and reset_gold_spent().

bool wb::side_actions::hidden_
private
size_t wb::side_actions::team_index_
private
bool wb::side_actions::team_index_defined_
private

Definition at line 565 of file side_actions.hpp.

Referenced by set_team_index(), and team_index().


The documentation for this class was generated from the following files: