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>
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_ptr > | actions_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_ |
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.
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.
typedef std::pair<const_iterator,const_iterator> wb::side_actions::crange_t |
Definition at line 293 of file side_actions.hpp.
typedef std::pair<const_reverse_iterator,const_reverse_iterator> wb::side_actions::crrange_t |
Definition at line 294 of file side_actions.hpp.
Definition at line 286 of file side_actions.hpp.
typedef config wb::side_actions::net_cmd |
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.
typedef std::pair<iterator,iterator> wb::side_actions::range_t |
Definition at line 291 of file side_actions.hpp.
Definition at line 288 of file side_actions.hpp.
typedef std::pair<reverse_iterator,reverse_iterator> wb::side_actions::rrange_t |
Definition at line 292 of file side_actions.hpp.
wb::side_actions::side_actions | ( | ) |
Definition at line 250 of file side_actions.cpp.
std::deque< action_ptr > wb::side_actions::actions_of | ( | unit const & | unit | ) |
Definition at line 595 of file side_actions.cpp.
References actions_, wb::side_actions_container::get(), and unit::underlying_id().
|
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().
|
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.
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.
Definition at line 522 of file side_actions.cpp.
References bump_earlier(), and end().
Referenced by execute_net_cmd().
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().
|
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 | ) |
Definition at line 590 of file side_actions.cpp.
References actions_, wb::side_actions_container::get(), and unit::underlying_id().
|
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<<().
|
inline |
Returns the iterator for the position after the last executed action within the actions queue.
Definition at line 415 of file side_actions.hpp.
References actions_, and wb::side_actions_container::end().
Referenced by bump_earlier(), bump_later(), execute_net_cmd(), wb::find_action_at(), find_last_action_of(), get_numbers(), get_position_of(), get_turn_num_of(), wb::highlighter::last_action_redraw(), make_net_cmd_refresh(), raw_turn_shift(), remove_action(), and synced_enqueue().
|
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.
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().
Definition at line 698 of file side_actions.cpp.
References actions_, bump_later(), config::child(), config::child_range(), clear(), end(), ERR_WB, wb::action::from_config(), get_turn(), hidden_, display::invalidate(), itor, LOG_WB, pos, wb::side_actions_container::replace(), safe_erase(), safe_insert(), resources::screen, turn_begin(), and resources::whiteboard.
bool wb::side_actions::execute_next | ( | ) |
Executes the first action in the queue, and then deletes it.
Definition at line 301 of file side_actions.cpp.
side_actions::iterator wb::side_actions::find_first_action_at | ( | map_location | hex | ) |
Find the first action occurring at a given hex.
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().
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.
between | the two iterators between which the action will be searched. |
limit | the lower bound to search from, that is the return value `it' will verify !comp(limit, it). |
comp | the predicate to compare with. |
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().
side_actions::const_iterator wb::side_actions::find_first_action_of | ( | std::pair< T, T > | between, |
const_iterator | limit, | ||
Compare | comp | ||
) | const |
Definition at line 605 of file side_actions.hpp.
References actions_, wb::side_actions_container::end(), and wb::side_actions_container::project().
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.
Definition at line 561 of file side_actions.cpp.
References actions_, find_first_action_of(), wb::side_actions_container::get(), and unit::underlying_id().
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.
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().
|
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 | ||
) |
Gets called when display is drawing a hex to determine which numbers to draw on it.
Definition at line 266 of file side_actions.cpp.
References begin(), empty(), end(), wb::side_actions::numbers_t::main_number, schema_validation::number, wb::side_actions::numbers_t::numbers_to_draw, wb::side_actions::numbers_t::secondary_numbers, team_index(), wb::side_actions::numbers_t::team_numbers, and resources::whiteboard.
Referenced by wb::manager::draw_hex().
|
inline |
action | The action whose position you're looking for |
Definition at line 400 of file side_actions.hpp.
References begin(), end(), and gui2::event::find().
|
inline |
Returns the turn of a given iterator planned execution.
The value returned is the difference between the planned turn and the current turn.
0 | If 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.
0 | if 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().
|
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.
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.
|
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().
|
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 |
Definition at line 798 of file side_actions.cpp.
References config::add_child(), and pos.
Referenced by make_net_cmd_insert(), make_net_cmd_refresh(), synced_enqueue(), and synced_insert().
side_actions::net_cmd wb::side_actions::make_net_cmd_insert | ( | const_iterator const & | pos, |
action_const_ptr | act | ||
) | const |
Definition at line 807 of file side_actions.cpp.
References actions_, begin(), get_turn(), make_net_cmd_insert(), and wb::side_actions_container::position_in_turn().
side_actions::net_cmd wb::side_actions::make_net_cmd_refresh | ( | ) | const |
Definition at line 847 of file side_actions.cpp.
References actions_, config::add_child(), begin(), end(), get_turn(), itor, make_net_cmd_insert(), and wb::side_actions_container::position_in_turn().
Referenced by synced_turn_shift().
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 |
Definition at line 816 of file side_actions.cpp.
References actions_, config::add_child(), get_turn(), and wb::side_actions_container::position_in_turn().
Referenced by execute().
|
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.
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.
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.
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.
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.
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.
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.
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 | ( | ) |
Definition at line 859 of file side_actions.cpp.
References actions_, begin(), end(), wb::side_actions_container::erase(), get_turn(), iter_turn(), itor, safe_insert(), turn_begin(), turn_end(), and wb::side_actions_container::turn_shift().
Referenced by synced_turn_shift().
|
inline |
reverse version of the above
Definition at line 407 of file side_actions.hpp.
References actions_, and wb::side_actions_container::rbegin().
|
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.
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().
|
inline |
reverse version of the above
Definition at line 417 of file side_actions.hpp.
References actions_, and wb::side_actions_container::rend().
|
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().
|
inline |
Definition at line 433 of file side_actions.hpp.
References actions_, and wb::side_actions_container::riter_turn().
|
inline |
Definition at line 435 of file side_actions.hpp.
References actions_, and wb::side_actions_container::riter_turn().
|
private |
Definition at line 660 of file side_actions.cpp.
References actions_, wb::side_actions_container::erase(), itor, and resources::whiteboard.
Referenced by execute_net_cmd(), and synced_erase().
|
private |
Definition at line 626 of file side_actions.cpp.
References actions_, wb::side_actions_container::insert(), wb::side_actions_container::push_front(), and turn_begin().
Referenced by execute_net_cmd(), and raw_turn_shift().
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_.
|
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().
|
private |
Definition at line 648 of file side_actions.cpp.
References actions_, end(), make_net_cmd_insert(), wb::side_actions_container::queue(), team_index_, turn_size(), and resources::whiteboard.
Referenced by queue_action().
|
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().
|
private |
Definition at line 642 of file side_actions.cpp.
References actions_, wb::side_actions_container::insert(), make_net_cmd_insert(), team_index_, and resources::whiteboard.
Referenced by insert_action().
void wb::side_actions::synced_turn_shift | ( | ) |
Definition at line 893 of file side_actions.cpp.
References make_net_cmd_refresh(), raw_turn_shift(), team_index(), and resources::whiteboard.
|
inline |
Returns the team index this action queue belongs to.
Definition at line 303 of file side_actions.hpp.
References team_index_, and team_index_defined_.
Referenced by change_gold_spent_by(), get_numbers(), wb::manager::on_change_controller(), queue_attack(), queue_move(), queue_recall(), queue_recruit(), queue_suppose_dead(), reset_gold_spent(), set_team_index(), and synced_turn_shift().
|
inline |
Definition at line 422 of file side_actions.hpp.
References actions_, and wb::side_actions_container::turn_begin().
Referenced by wb::mapbuilder::build_map(), execute_net_cmd(), wb::for_each_action(), wb::operator<<(), raw_turn_shift(), and safe_insert().
|
inline |
Definition at line 426 of file side_actions.hpp.
References actions_, and wb::side_actions_container::turn_begin().
|
inline |
Definition at line 423 of file side_actions.hpp.
References actions_, and wb::side_actions_container::turn_end().
Referenced by wb::mapbuilder::build_map(), execute(), wb::for_each_action(), wb::operator<<(), and raw_turn_shift().
|
inline |
Definition at line 427 of file side_actions.hpp.
References actions_, and wb::side_actions_container::turn_end().
|
inline |
Definition at line 424 of file side_actions.hpp.
References actions_, and wb::side_actions_container::turn_rbegin().
|
inline |
Definition at line 428 of file side_actions.hpp.
References actions_, and wb::side_actions_container::turn_rbegin().
|
inline |
Definition at line 425 of file side_actions.hpp.
References actions_, and wb::side_actions_container::turn_rend().
|
inline |
Definition at line 429 of file side_actions.hpp.
References actions_, and wb::side_actions_container::turn_rend().
|
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 | ) |
Definition at line 585 of file side_actions.cpp.
References actions_, gui2::event::find(), wb::side_actions_container::get(), and unit::underlying_id().
|
private |
Definition at line 562 of file side_actions.hpp.
Referenced by actions_of(), begin(), bump_earlier(), clear(), count_actions_of(), empty(), end(), execute(), execute_net_cmd(), find_first_action_at(), find_first_action_of(), find_last_action_of(), get_turn(), insert_action(), iter_turn(), make_net_cmd_bump_later(), make_net_cmd_insert(), make_net_cmd_refresh(), make_net_cmd_remove(), make_net_cmd_replace(), num_turns(), raw_turn_shift(), rbegin(), remove_action(), rend(), riter_turn(), safe_erase(), safe_insert(), size(), synced_enqueue(), synced_insert(), turn_begin(), turn_end(), turn_rbegin(), turn_rend(), turn_size(), and unit_has_actions().
|
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().
|
private |
Definition at line 570 of file side_actions.hpp.
Referenced by execute_net_cmd(), hidden(), hide(), queue_attack(), queue_move(), queue_recall(), queue_recruit(), queue_suppose_dead(), and show().
|
private |
Definition at line 564 of file side_actions.hpp.
Referenced by bump_earlier(), execute(), set_team_index(), synced_enqueue(), synced_erase(), synced_insert(), and team_index().
|
private |
Definition at line 565 of file side_actions.hpp.
Referenced by set_team_index(), and team_index().