15 #ifndef GAME_EVENTS_MANAGER_HPP
16 #define GAME_EVENTS_MANAGER_HPP
21 #include <boost/noncopyable.hpp>
22 #include <boost/scoped_ptr.hpp>
23 #include <boost/shared_ptr.hpp>
37 class t_event_handlers;
74 {
return !bool(ptr) ?
end_ : std::min(ptr->index(),
end_); }
85 const handler_vec::size_type
end_;
102 boost::scoped_ptr<game_events::t_pump>
pump_;
void remove_event_handler(const std::string &id)
Removes an event handler.
boost::scoped_ptr< game_events::t_pump > pump_
static thandler * handler
handler_list::iterator main_it_
The current (or next) element from main_list_.
void write_events(config &cfg)
GLuint GLuint GLsizei GLenum type
const handler_list & var_list_
The varying-name event handlers for this iteration.
Handler list iterators are rather limited.
std::pair< const_child_iterator, const_child_iterator > const_child_itors
handler_list::iterator var_it_
The current (or next) element from var_list_.
game_events::wmi_container wml_menu_items_
void read_scenario(const config &scenario_cfg)
This is a wrapper for a list of weak pointers to handlers.
std::set< std::string > unit_wml_ids_
Declarations for a container for wml_menu_item.
const std::string event_name_
The event name for this iteration.
void add_event_handler(const config &handler, bool is_menu_item=false)
Create an event handler.
A container of wml_menu_item.
const handler_list & main_list_
The fixed-name event handlers for this iteration.
bool main_is_current_
true if the most recent dereference was taken from main_list_.
The game event manager loads the scenario configuration object, and ensures that events are handled a...
This class is similar to an input iterator through event handlers, except each instance knows its own...
game_events::t_pump & pump()
iteration(const std::string &event_name, manager &)
Event-specific constructor.
bool current_is_known_
Set to true upon dereferencing.
Define the handlers for the game's events mechanism.
handler_ptr operator*()
Dereference Will return a null pointer when the end of the iteration is reached.
Container associating units to locations.
boost::scoped_ptr< t_event_handlers > event_handlers_
iteration & operator++()
Increment Incrementing guarantees that the next dereference will differ from the previous derference ...
const handler_vec::size_type end_
The end of this iteration.
A config object defines a single node in a WML file, with access to child nodes.
void add_events(const config::const_child_itors &cfgs, const std::string &type=std::string())
GLsizei const GLcharARB ** string
handler_vec::size_type ptr_index(const handler_ptr &ptr) const
Gets the index from a pointer, capped at end_.