Removed config::child_list from game_events.hpp.

This commit is contained in:
Guillaume Melquiond 2009-03-20 07:08:18 +00:00
parent c85da90f96
commit 70a445416d
4 changed files with 8 additions and 8 deletions

View File

@ -3691,13 +3691,13 @@ namespace game_events {
return pump();
}
void add_events(const config::child_list& cfgs,const std::string& id)
void add_events(const config::const_child_itors &cfgs, const std::string &id)
{
if(std::find(unit_wml_ids.begin(),unit_wml_ids.end(),id) == unit_wml_ids.end()) {
unit_wml_ids.insert(id);
for(config::child_list::const_iterator new_ev = cfgs.begin(); new_ev != cfgs.end(); ++ new_ev) {
foreach (const config &new_ev, cfgs) {
std::vector<game_events::event_handler> &temp = (pump_manager::count()) ? new_handlers : event_handlers;
temp.push_back(game_events::event_handler(vconfig(*new_ev, true)));
temp.push_back(game_events::event_handler(vconfig(&new_ev, true)));
}
}
}

View File

@ -279,7 +279,7 @@ namespace game_events
game_state* get_state_of_game();
void write_events(config& cfg);
void add_events(const config::child_list& cfgs,const std::string& id);
void add_events(const config::const_child_itors &cfgs,const std::string& id);
bool unit_matches_filter(unit_map::const_iterator itor, const vconfig filter);

View File

@ -184,7 +184,7 @@ void play_controller::init(CVideo& video){
// add era events for MP game
const config* era_cfg = level_.child("era");
if (era_cfg != NULL) {
game_events::add_events(era_cfg->get_children("event"),"era_events");
game_events::add_events(era_cfg->child_range("event"), "era_events");
}

View File

@ -578,7 +578,7 @@ void unit::set_game_context(unit_map* unitmap, const gamemap* map, const gamesta
gamestatus_ = game_status;
// In case the unit carries EventWML, apply it now
game_events::add_events(cfg_.get_children("event"),type_);
game_events::add_events(cfg_.child_range("event"), type_);
}
// Apply mandatory traits (e.g. undead, mechanical) to a unit and then
@ -763,7 +763,7 @@ void unit::advance_to(const unit_type* t, bool use_traits, game_state* state)
heal_all();
}
game_events::add_events(cfg_.get_children("event"),type_);
game_events::add_events(cfg_.child_range("event"), type_);
set_state("poisoned","");
set_state("slowed","");
@ -1562,7 +1562,7 @@ void unit::read(const config& cfg, bool use_traits, game_state* state)
cfg_["generate_name"] = "";
}
game_events::add_events(cfg_.get_children("event"),type_);
game_events::add_events(cfg_.child_range("event"), type_);
// Make the default upkeep "full"
if(cfg_["upkeep"].empty()) {
cfg_["upkeep"] = "full";