Nebula
Loading...
Searching...
No Matches
manager.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
19#include "core/refcounted.h"
20#include "ids/id.h"
21
22//------------------------------------------------------------------------------
23namespace Game
24{
25
26class World;
27
28//------------------------------------------------------------------------------
32{
34public:
36 Manager();
38 virtual ~Manager();
39
41 bool IsActive() const;
42
43 // TODO: RegisterTypes?
44
45 virtual void OnActivate();
47 virtual void OnDeactivate();
49 virtual void OnBeginFrame() {}
51 virtual void OnBeforeViews() {}
53 virtual void OnFrame() {}
55 virtual void OnEndFrame() {}
57 virtual void OnDecay() {}
59 virtual void OnLoad(World*) {}
61 virtual void OnSave(World*) {}
63 virtual void OnCleanup(World*) {}
65 virtual void OnStart(World*) {}
67 virtual void OnRenderDebug() {}
68
69private:
70 bool isActive = false;
71};
72
73//------------------------------------------------------------------------------
76inline bool
78{
79 return this->isActive;
80}
81
82}; // namespace Game
83//------------------------------------------------------------------------------
84
85
The common base class of Nebula.
Definition refcounted.h:38
Definition manager.h:32
virtual void OnLoad(World *)
called after loading game state
Definition manager.h:59
virtual void OnEndFrame()
called after frame by the feature
Definition manager.h:55
virtual void OnDeactivate()
called when removed from game server
Definition manager.cc:43
virtual __DeclareClass(Manager) public ~Manager()
destructor
Definition manager.cc:24
virtual void OnBeforeViews()
Called between begin frame and before views.
Definition manager.h:51
virtual void OnFrame()
called per-frame by the feature
Definition manager.h:53
virtual void OnDecay()
called before cleaning up managed properties decay buffers
Definition manager.h:57
virtual void OnActivate()
Definition manager.cc:33
virtual void OnSave(World *)
called before saving game state
Definition manager.h:61
virtual void OnRenderDebug()
render a debug visualization
Definition manager.h:67
virtual void OnStart(World *)
called by Game::Server::Start()
Definition manager.h:65
virtual void OnCleanup(World *)
called before unloading game state
Definition manager.h:63
bool IsActive() const
return true if currently active
Definition manager.h:77
virtual void OnBeginFrame()
called before frame by the feature
Definition manager.h:49
bool isActive
Definition manager.h:70
Definition world.h:50
Game::EditorState.
Definition orientation.h:7
#define __DeclareClass(type)