28 val[
"type"] = type_id;
31 from.
write(leader_position);
40 val[
"value"] = unit_id;
43 from.
write(leader_position);
52 val[
"value"] = unit_id;
65 assert(!steps.empty());
71 move[
"skip_sighted"] =
"all";
73 else if(skip_ally_sighted && !skip_sighted)
75 move[
"skip_sighted"] =
"only_ally";
89 int att_weapon,
int def_weapon,
const std::string& attacker_type_id,
90 const std::string& defender_type_id,
int attacker_lvl,
91 int defender_lvl,
const std::size_t turn,
const time_of_day &
t)
102 move[
"weapon"] = att_weapon;
103 move[
"defender_weapon"] = def_weapon;
104 move[
"attacker_type"] = attacker_type_id;
105 move[
"defender_type"] = defender_type_id;
106 move[
"attacker_lvl"] = attacker_lvl;
107 move[
"defender_lvl"] = defender_lvl;
108 move[
"turn"] =
static_cast<int>(turn);
123 child[
"active"] = turned_on;
151 if(last_select_loc !=
nullptr && last_select_loc->
valid())
154 last_select_loc->
write(source);
162 child[
"code"] = lua_code;
A config object defines a single node in a WML file, with access to child nodes.
config & add_child(config_key_type key)
int current_side() const
Returns the number of the side whose turn it is.
static config get_lua_ai(const std::string &lua_code)
static config get_movement(const std::vector< map_location > &steps, bool skip_sighted, bool skip_ally_sighted)
Records a move that follows the provided steps.
static config get_init_side()
static config get_attack(const map_location &a, const map_location &b, int att_weapon, int def_weapon, const std::string &attacker_type_id, const std::string &defender_type_id, int attacker_lvl, int defender_lvl, const std::size_t turn, const time_of_day &t)
static config get_recall(const std::string &unit_id, const map_location &loc, const map_location &from)
static config get_auto_shroud(bool turned_on)
Records that the player has toggled automatic shroud updates.
static config get_recruit(const std::string &type_id, const map_location &loc, const map_location &from)
static config get_update_shroud()
Records that the player has manually updated fog/shroud.
static config get_disband(const std::string &unit_id)
static config get_event(const std::string &name, const map_location &loc, const map_location *last_select_loc)
void write_locations(const std::vector< map_location > &locs, config &cfg)
Write a vector of locations into a config adding keys x=x1,x2,..,xn and y=y1,y2,.....
play_controller * controller
rect dst
Location on the final composed sheet.
rect src
Non-transparent portion of the surface to compose.
Encapsulates the map of the game.
void write(config &cfg) const
Object which defines a time of day with associated bonuses, image, sounds etc.