38 virtual void error(
const std::string& message)
60 typedef std::map<std::string, handler>
map;
74 #define SYNCED_COMMAND_HANDLER_FUNCTION(pname, pcfg, spectator) \
75 static bool synced_command_func_##pname(const config& pcfg, action_spectator& spectator); \
76 static synced_command synced_command_action_##pname(#pname, &synced_command_func_##pname); \
77 static bool synced_command_func_##pname(const config& pcfg, action_spectator& spectator)
action_spectator()=default
virtual ~action_spectator()=default
error_handler_function eh_
virtual void error(const std::string &message)
Called when synced_context::run received nonsensial data based on the current gamestate.
std::function< void(const std::string &)> error_handler_function
action_spectator(error_handler_function eh)
A config object defines a single node in a WML file, with access to child nodes.
bool(* handler)(const config &, action_spectator &spectator)
synced_command(const std::string &tag, handler function)
static map & registry()
using static function variable instead of static member variable to prevent static initialization fia...
std::function< void(const std::string &)> error_handler_function
std::map< std::string, handler > map
std::string tag(const std::string &tag_name, Args &&... contents)