22 #ifndef QDENGINE_QDCORE_UTIL_RESOURCE_DISPATCHER_H 23 #define QDENGINE_QDCORE_UTIL_RESOURCE_DISPATCHER_H 25 #include "qdengine/qdcore/util/Handle.h" 26 #include "qdengine/qdcore/util/SynchroTimer.h" 52 virtual void init_time(time_type time_) {
53 time = time_ + time_step();
55 virtual time_type time_step() {
64 typedef void (*type)();
68 virtual ~VoidFunctionCallResourceUser() {}
81 typedef void (T::*type)();
85 virtual ~MemberFunctionCallResourceUser() {}
103 void setTimer(
int syncro_by_clock, time_type time_per_frame, time_type max_time_interval_) {
104 _syncro_timer.set(syncro_by_clock, time_per_frame, _max_time_interval = max_time_interval_);
111 user->init_time(_syncro_timer());
113 void attach(
void (*func)(), time_type dtime) {
117 void attach(T &obj,
void (T::*func)(), time_type dtime) {
131 _syncro_timer.skip();
134 void set_speed(
float speed) {
135 _syncro_timer.setSpeed(speed);
144 time_type _max_time_interval;
152 #endif // QDENGINE_QDCORE_UTIL_RESOURCE_DISPATCHER_H Definition: ResourceDispatcher.h:34
Definition: ResourceDispatcher.h:100
Definition: SynchroTimer.h:31
Базовый класс для игровых ресурсов.
Definition: console.h:28
Definition: ResourceDispatcher.h:62
Definition: ResourceDispatcher.h:79