The Battle for Wesnoth  1.19.0-dev
simulated_actions.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2024
3  by Guorui Xi <kevin.xgr@gmail.com>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 /**
17  * Implement simulated actions
18  * @file
19  */
20 
21 #pragma once
22 
23 #include "ai/game_info.hpp"
24 
25 
26 class unit_type;
27 
28 namespace ai{
29 
30 bool simulated_attack(const map_location& attacker_loc, const map_location& defender_loc, double attacker_hp, double defender_hp);
31 
32 bool simulated_move(int side, const map_location& from, const map_location& to, int steps, map_location& unit_location);
33 
34 bool simulated_recall(int side, const std::string& unit_id, const map_location& recall_location);
35 
36 bool simulated_recruit(int side, const unit_type* u, const map_location& recruit_location);
37 
38 bool simulated_stopunit(const map_location& unit_location, bool remove_movement, bool remove_attacks);
39 
41 
42 }
A single unit type that the player may recruit.
Definition: types.hpp:43
Game information for the AI.
A small explanation about what's going on here: Each action has access to two game_info objects First...
Definition: actions.cpp:59
bool simulated_attack(const map_location &attacker_loc, const map_location &defender_loc, double attacker_hp, double defender_hp)
bool simulated_stopunit(const map_location &unit_location, bool remove_movement, bool remove_attacks)
bool simulated_move(int side, const map_location &from, const map_location &to, int steps, map_location &unit_location)
bool simulated_recruit(int side, const unit_type *u, const map_location &recruit_location)
bool simulated_synced_command()
bool simulated_recall(int side, const std::string &unit_id, const map_location &recall_location)
Encapsulates the map of the game.
Definition: location.hpp:38