#include <actions.hpp>
List of all members.
Static Public Member Functions |
| static attack_result_ptr | execute_attack_action (side_number side, bool execute, const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon, double aggression) |
| | Ask the game to attack an enemy defender using our unit attacker from attackers current location,.
|
| static move_result_ptr | execute_move_action (side_number side, bool execute, const map_location &from, const map_location &to, bool remove_movement, bool unreach_is_ok=false) |
| | Ask the game to move our unit from location 'from' to location 'to', optionally - doing a partial move.
|
| static recall_result_ptr | execute_recall_action (side_number side, bool execute, const std::string &unit_id, const map_location &where, const map_location &from) |
| | Ask the game to recall a unit for us on specified location.
|
| static recruit_result_ptr | execute_recruit_action (side_number side, bool execute, const std::string &unit_name, const map_location &where, const map_location &from) |
| | Ask the game to recruit a unit for us on specified location.
|
| static stopunit_result_ptr | execute_stopunit_action (side_number side, bool execute, const map_location &unit_location, bool remove_movement, bool remove_attacks) |
| | Ask the game to remove unit movements and/or attack.
|
| static const std::string & | get_error_name (int error_code) |
| | get human-readable name of the error by code.
|
Static Private Attributes |
| static std::map< int, std::string > | error_names_ |
Detailed Description
Definition at line 300 of file actions.hpp.
Member Function Documentation
Ask the game to attack an enemy defender using our unit attacker from attackers current location,.
- Parameters:
-
| side | the side which tries to execute the move |
| execute | should move be actually executed or not |
| attacker_loc | location of attacker |
| defender_loc | location of defender |
| attacker_weapon | weapon of attacker |
| aggression | aggression of attacker, is used to determine attacker's weapon if it is not specified |
- Return values:
-
| possible | result: ok |
| possible | result: something wrong |
| possible | result: attacker and/or defender are invalid |
| possible | result: attacker doesn't have the specified weapon |
Definition at line 1017 of file actions.cpp.
Referenced by ai::ai_attack(), and ai::readonly_context_impl::check_attack_action().
Ask the game to move our unit from location 'from' to location 'to', optionally - doing a partial move.
- Parameters:
-
| side | the side which tries to execute the move |
| execute | should move be actually executed or not |
| from | location of our unit |
| to | where to move |
| remove_movement | set unit movement to 0 in case of successful move |
- Return values:
-
| possible | result: ok |
| possible | result: something wrong |
| possible | result: move is interrupted |
| possible | result: move is impossible |
Definition at line 1031 of file actions.cpp.
Referenced by ai::ai_move(), and ai::readonly_context_impl::check_move_action().
Ask the game to recall a unit for us on specified location.
- Parameters:
-
| side | the side which tries to execute the move |
| execute | should move be actually executed or not |
| unit_id | the id of the unit to be recalled. |
| where | location where the unit is to be recalled. |
- Return values:
-
| 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 |
Definition at line 1045 of file actions.cpp.
Referenced by ai::ai_recall(), and ai::readonly_context_impl::check_recall_action().
Ask the game to recruit a unit for us on specified location.
- Parameters:
-
| side | the side which tries to execute the move |
| execute | should move be actually executed or not |
| unit_name | the name of the unit to be recruited. |
| where | location where the unit is to be recruited. |
- Return values:
-
| 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 |
Definition at line 1058 of file actions.cpp.
Referenced by ai::ai_recruit(), and ai::readonly_context_impl::check_recruit_action().
Ask the game to remove unit movements and/or attack.
- Parameters:
-
| side | the side which tries to execute the move |
| execute | should move be actually executed or not |
| unit_location | the location of our unit |
| remove_movement | set remaining movements to 0 |
| remove_attacks | set remaining attacks to 0 |
- Return values:
-
| possible | result: ok |
| possible_result,: | something wrong |
| possible_result,: | nothing to do |
Definition at line 1071 of file actions.cpp.
Referenced by ai::ai_stopunit_select(), and ai::readonly_context_impl::check_stopunit_action().
| const std::string & ai::actions::get_error_name |
( |
int |
error_code |
) |
[static] |
get human-readable name of the error by code.
- Parameters:
-
- Return values:
-
| result | the name of the error. |
Definition at line 1084 of file actions.cpp.
Member Data Documentation
The documentation for this class was generated from the following files: