#include <contexts.hpp>


Public Member Functions | |
| virtual readwrite_context & | get_readwrite_context () |
| Unwrap - this class is not a proxy, so return *this. | |
| virtual attack_result_ptr | execute_attack_action (const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon) |
| Ask the game to attack an enemy defender using our unit attacker from attackers current location,. | |
| virtual move_result_ptr | execute_move_action (const map_location &from, const map_location &to, bool remove_movement=true) |
| Ask the game to move our unit from location 'from' to location 'to', optionally - doing a partial move. | |
| virtual recall_result_ptr | execute_recall_action (const std::string &id, const map_location &where=map_location::null_location, const map_location &from=map_location::null_location) |
| Ask the game to recall a unit for us on specified location. | |
| virtual recruit_result_ptr | execute_recruit_action (const std::string &unit_name, const map_location &where=map_location::null_location, const map_location &from=map_location::null_location) |
| Ask the game to recruit a unit for us on specified location. | |
| virtual stopunit_result_ptr | execute_stopunit_action (const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false) |
| Ask the game to remove unit movements and/or attack. | |
| virtual team & | current_team_w () |
| Return a reference to the 'team' object for the AI. | |
| void | raise_gamestate_changed () const |
| Notifies all interested observers of the event respectively. | |
| readwrite_context_impl (readonly_context &context, const config &) | |
| Constructor. | |
| virtual | ~readwrite_context_impl () |
| virtual game_info & | get_info_w () |
| Functions to retrieve the 'info' object. | |
| virtual int | get_recursion_count () const |
| Get the value of the recursion counter. | |
| virtual config | to_readwrite_context_config () const |
| serialize this context to config | |
Private Attributes | |
| recursion_counter | recursion_counter_ |
Definition at line 1482 of file contexts.hpp.
| ai::readwrite_context_impl::readwrite_context_impl | ( | readonly_context & | context, | |
| const config & | ||||
| ) | [inline] |
Constructor.
Definition at line 1569 of file contexts.hpp.
References ai::readonly_context_proxy::init_readonly_context_proxy().

| virtual ai::readwrite_context_impl::~readwrite_context_impl | ( | ) | [inline, virtual] |
Definition at line 1576 of file contexts.hpp.
| team & ai::readwrite_context_impl::current_team_w | ( | ) | [virtual] |
Return a reference to the 'team' object for the AI.
Implements ai::readwrite_context.
Definition at line 85 of file contexts.cpp.
References ai::side_context_proxy::get_side(), and resources::teams.

| attack_result_ptr ai::readwrite_context_impl::execute_attack_action | ( | const map_location & | attacker_loc, | |
| const map_location & | defender_loc, | |||
| int | attacker_weapon | |||
| ) | [virtual] |
Ask the game to attack an enemy defender using our unit attacker from attackers current location,.
| attacker_loc | location of attacker | |
| defender_loc | location of defender | |
| attacker_weapon | weapon of attacker |
| possible | result: ok | |
| possible | result: something wrong | |
| possible | result: attacker and/or defender are invalid | |
| possible | result: attacker and/or defender are invalid | |
| possible | result: attacker doesn't have the specified weapon |
Implements ai::readwrite_context.
Definition at line 90 of file contexts.cpp.
References unit_map::find(), ai::readonly_context_proxy::get_aggression(), ai::readonly_context_proxy::get_leader_aggression(), ai::side_context_proxy::get_side(), resources::units, and unit_map::iterator_base< iter_types >::valid().

| move_result_ptr ai::readwrite_context_impl::execute_move_action | ( | const map_location & | from, | |
| const map_location & | to, | |||
| bool | remove_movement = true | |||
| ) | [virtual] |
Ask the game to move our unit from location 'from' to location 'to', optionally - doing a partial move.
| from | location of our unit | |
| to | where to move | |
| remove_movement | set unit movement to 0 in case of successful move |
| possible | result: ok | |
| possible | result: something wrong | |
| possible | result: move is interrupted | |
| possible | result: move is impossible |
Implements ai::readwrite_context.
Definition at line 104 of file contexts.cpp.
References ai::side_context_proxy::get_side().

| recall_result_ptr ai::readwrite_context_impl::execute_recall_action | ( | const std::string & | id, | |
| const map_location & | where = map_location::null_location, |
|||
| const map_location & | from = map_location::null_location | |||
| ) | [virtual] |
Ask the game to recall a unit for us on specified location.
| id | the id of the unit to be recalled. | |
| where | location where the unit is to be recalled. |
| possible | result: ok | |
| possible_result,: | something wrong | |
| possible_result,: | leader not on keep | |
| possible_result,: | no free space on keep | |
| possible_result,: | not enough gold |
Implements ai::readwrite_context.
Definition at line 114 of file contexts.cpp.
References ai::side_context_proxy::get_side().

| recruit_result_ptr ai::readwrite_context_impl::execute_recruit_action | ( | const std::string & | unit_name, | |
| const map_location & | where = map_location::null_location, |
|||
| const map_location & | from = map_location::null_location | |||
| ) | [virtual] |
Ask the game to recruit a unit for us on specified location.
| unit_name | the name of the unit to be recruited. | |
| where | location where the unit is to be recruited. |
| possible | result: ok | |
| possible_result,: | something wrong | |
| possible_result,: | leader not on keep | |
| possible_result,: | no free space on keep | |
| possible_result,: | not enough gold |
Implements ai::readwrite_context.
Definition at line 119 of file contexts.cpp.
References ai::side_context_proxy::get_side().

| stopunit_result_ptr ai::readwrite_context_impl::execute_stopunit_action | ( | const map_location & | unit_location, | |
| bool | remove_movement = true, |
|||
| bool | remove_attacks = false | |||
| ) | [virtual] |
Ask the game to remove unit movements and/or attack.
| unit_location | the location of our unit | |
| remove_movement | set remaining movements to 0 | |
| remove_attacks | set remaining attacks to 0 |
| possible | result: ok | |
| possible_result,: | something wrong | |
| possible_result,: | nothing to do |
Implements ai::readwrite_context.
Definition at line 134 of file contexts.cpp.
References ai::side_context_proxy::get_side().

| game_info & ai::readwrite_context_impl::get_info_w | ( | ) | [virtual] |
Functions to retrieve the 'info' object.
Used by derived classes to discover all necessary game information.
Implements ai::readwrite_context.
Definition at line 284 of file contexts.cpp.
References ai::manager::get_active_ai_info_for_side(), and ai::side_context_proxy::get_side().

| virtual readwrite_context& ai::readwrite_context_impl::get_readwrite_context | ( | ) | [inline, virtual] |
Unwrap - this class is not a proxy, so return *this.
Implements ai::readwrite_context.
Definition at line 1487 of file contexts.hpp.
| int ai::readwrite_context_impl::get_recursion_count | ( | ) | const [virtual] |
Get the value of the recursion counter.
Implements ai::side_context.
Definition at line 67 of file contexts.cpp.
References ai::recursion_counter::get_count(), and recursion_counter_.

| void ai::readwrite_context_impl::raise_gamestate_changed | ( | ) | const [virtual] |
Notifies all interested observers of the event respectively.
Implements ai::readwrite_context.
Definition at line 79 of file contexts.cpp.
| config ai::readwrite_context_impl::to_readwrite_context_config | ( | ) | const [virtual] |
serialize this context to config
Implements ai::readwrite_context.
Definition at line 247 of file contexts.cpp.
Definition at line 1593 of file contexts.hpp.
Referenced by get_recursion_count().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:18:53 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |