-
Notifications
You must be signed in to change notification settings - Fork 0
engine::object_subscription_list
Paweł Waligóra edited this page May 23, 2024
·
1 revision
This is the core of the entire engine.
meant to be used by modules to call their components
module.h
#include"object_subscription_list.h"
namespace module {
extern engine::object_subscribtion_list<my_object> objects;
// other module variables, functions
}
module.cpp
#include"module.h"
engine::object_subscribtion_list<my_object> module::object;
// other definitions
usage code:
#include "module.h"
// subscribing
my_object mo;
module::objects.subscribe(mo);
// call subscribers
module::events.perform_on_all([](my_object* mop) { mop->method(); };
// unsubscribing
module::events.unsubscribe(&mo);
It is preffered for objects to subscribe at constructor and unsubscribe at destructor.
- engine
- scripts_system
- scene_loader
- time_system
-
input_system
- input_system::key_held
- input_system::key_events
- input_system::subscribe() (deprecated)
- input_system::axis_state()
- input_system::key_bind
- input_system::axis
- input_system::double_axis
- input_system::triple_axis
- input_system::axis2
- input_system::double_axis2
- input_system::triple_axis2
- input_system::axis-choice
- renderer
- physics
- ui_system
- game