The Battle for Wesnoth  1.19.6+dev
Namespaces | Macros | Functions | Variables
simulated_actions.cpp File Reference

Implement simulated actions. More...

#include "ai/simulated_actions.hpp"
#include "game_board.hpp"
#include "game_config.hpp"
#include "log.hpp"
#include "map/map.hpp"
#include "random.hpp"
#include "recall_list_manager.hpp"
#include "resources.hpp"
#include "team.hpp"
#include "units/unit.hpp"
#include "units/helper.hpp"
#include "units/ptr.hpp"
#include "units/types.hpp"
Include dependency graph for simulated_actions.cpp:

Go to the source code of this file.

Namespaces

 ai
 A small explanation about what's going on here: Each action has access to two game_info objects First is 'info' - real information Second is 'subjective info' - AIs perception of what's going on So, when we check_before action, we use 'subjective info' and don't touch real 'info' at all.
 

Macros

#define DBG_AI_SIM_ACTIONS   LOG_STREAM(debug, log_ai_sim_actions)
 
#define LOG_AI_SIM_ACTIONS   LOG_STREAM(info, log_ai_sim_actions)
 
#define WRN_AI_SIM_ACTIONS   LOG_STREAM(warn, log_ai_sim_actions)
 
#define ERR_AI_SIM_ACTIONS   LOG_STREAM(err, log_ai_sim_actions)
 

Functions

void ai::helper_check_village (const map_location &loc, int side)
 
void ai::helper_place_unit (const unit &u, const map_location &loc)
 
void ai::helper_advance_unit (const map_location &loc)
 
bool ai::simulated_attack (const map_location &attacker_loc, const map_location &defender_loc, double attacker_hp, double defender_hp)
 
bool ai::simulated_move (int side, const map_location &from, const map_location &to, int steps, map_location &unit_location)
 
bool ai::simulated_recall (int side, const std::string &unit_id, const map_location &recall_location)
 
bool ai::simulated_recruit (int side, const unit_type *u, const map_location &recruit_location)
 
bool ai::simulated_stopunit (const map_location &unit_location, bool remove_movement, bool remove_attacks)
 
bool ai::simulated_synced_command ()
 

Variables

static lg::log_domain ai::log_ai_sim_actions ("ai/sim_actions")
 

Detailed Description

Implement simulated actions.

Definition in file simulated_actions.cpp.

Macro Definition Documentation

◆ DBG_AI_SIM_ACTIONS

#define DBG_AI_SIM_ACTIONS   LOG_STREAM(debug, log_ai_sim_actions)

Definition at line 39 of file simulated_actions.cpp.

◆ ERR_AI_SIM_ACTIONS

#define ERR_AI_SIM_ACTIONS   LOG_STREAM(err, log_ai_sim_actions)

Definition at line 42 of file simulated_actions.cpp.

◆ LOG_AI_SIM_ACTIONS

#define LOG_AI_SIM_ACTIONS   LOG_STREAM(info, log_ai_sim_actions)

Definition at line 40 of file simulated_actions.cpp.

◆ WRN_AI_SIM_ACTIONS

#define WRN_AI_SIM_ACTIONS   LOG_STREAM(warn, log_ai_sim_actions)

Definition at line 41 of file simulated_actions.cpp.