Exemplo n.º 1
0
	void write(config & cfg) const
	{
		write_locations(route, cfg);
		view_info.write(cfg.add_child("unit"));
		cfg["village_owner"] = original_village_owner;
		cfg["village_timebonus"] = take_village_timebonus;
	}
Exemplo n.º 2
0
void positional_source::write_config(config& cfg) const
{
	cfg["sounds"] = files_;
	cfg["delay"] = min_delay_;
	cfg["chance"] = chance_;
	cfg["check_fogged"] = check_fogged_;
	cfg["check_shrouded"] = check_shrouded_;
	cfg["loop"] = loops_;
	cfg["full_range"] = range_;
	cfg["fade_range"] = faderange_;
	write_locations(locations_, cfg);
}
Exemplo n.º 3
0
/**
 * Writes this into the provided config.
 */
void undo_list::move_action::write(config & cfg) const
{
	cfg.add_child("replay_data", replay_data);
	cfg["type"] = "move";
	cfg["starting_direction"] = map_location::write_direction(starting_dir);
	cfg["starting_moves"] = starting_moves;
	cfg["time_bonus"] = countdown_time_bonus;
	cfg["village_owner"] = original_village_owner;
	write_locations(route, cfg);

	config & child = cfg.add_child("unit");
	view_info->write(child);
	child["goto_x"] = goto_hex.x + 1;
	child["goto_y"] = goto_hex.y + 1;
}
Exemplo n.º 4
0
/**
 * Records a move that follows the provided @a steps.
 * This should be the steps to be taken this turn, ending in an
 * apparently-unoccupied (from the moving team's perspective) hex.
 */
config replay_helper::get_movement(const std::vector<map_location>& steps, bool skip_sighted, bool skip_ally_sighted)
{
	assert(!steps.empty());

	config move;
	if(skip_sighted)
	{
		//note, that skip_ally_sighted has no effect if skip_sighted is true
		move["skip_sighted"] = "all";
	}
	else if(skip_ally_sighted && !skip_sighted)
	{
		move["skip_sighted"] = "only_ally";
	}
	else
	{
		//leave it empty
	}
	write_locations(steps, move);

	return move;
}
Exemplo n.º 5
0
	void write(config & cfg) const
	{
		write_locations(route, cfg);
		view_info.write(cfg.add_child("unit"));
	}