SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
SceneAttorney.h
1#ifndef SceneAttorney_H
2#define SceneAttorney_H
3
4#include "Scene.h"
5#include "SceneManager.h"
6
15{
16public:
22 {
23 private:
24 friend class SUNENGINE;
25 friend class SceneManager;
26 friend class SceneChangeStartStrategy;
27
31 static void Delete() { SceneManager::Delete(); }
32
37 static void InitializeScene(Scene* scene) { scene->Initialize(); }
38
43 static void Update(Scene* scene) { scene->Update(); }
44
49
54 static void Draw(Scene* scene) { scene->Draw(); }
55
60 static void EndScene(Scene* scene) { scene->SceneEnd(); }
61
66 static void ChangeScene(Scene* scene) { SceneManager::ChangeScene(scene); }
67 };
68
74 {
75 private:
76 friend class GameObject;
77 friend class Updatable;
78 friend class Drawable;
79 friend class Alarmable;
80 friend class Inputable;
81 friend class Collidable;
82
87 static void Register(Updatable* up) { SceneManager::GetCurrentScene()->Register(up); }
88
93 static void Deregister(Updatable* up) { SceneManager::GetCurrentScene()->Deregister(up); }
94
99 static void Register(Drawable* dr) { SceneManager::GetCurrentScene()->Register(dr); }
100
105 static void Deregister(Drawable* dr) { SceneManager::GetCurrentScene()->Deregister(dr); }
106
113 static void Register(Alarmable* al, AlarmableManager::ALARM_ID id, float t) { SceneManager::GetCurrentScene()->Register(al, id, t); }
114
121
128 static void Register(Inputable* in, AZUL_KEY k, EventType e) { SceneManager::GetCurrentScene()->Register(in, k, e); }
129
136 static void Deregister(Inputable* in, AZUL_KEY k, EventType e) { SceneManager::GetCurrentScene()->Deregister(in, k, e); }
137
144 static void Register(Inputable* in, AZUL_MOUSE m, EventType e) { SceneManager::GetCurrentScene()->Register(in, m, e); }
145
152 static void Deregister(Inputable* in, AZUL_MOUSE m, EventType e) { SceneManager::GetCurrentScene()->Deregister(in, m, e); }
153
154
160
166 };
167};
168
169#endif
EventType
Enum class representing the types of input events.
Definition EventType.h:19
ALARM_ID
Enum class representing the alarm IDs.
Definition AlarmableManager.h:22
Manages the registration and processing of collisions for GameObjects.
Definition CollisionManager.h:24
Base class for all command objects.
Definition CommandBase.h:19
Provides access to the game loop related functions of Scene.
Definition SceneAttorney.h:22
static void UpdateScene()
Updates the current scene.
Definition SceneAttorney.h:48
static void EndScene(Scene *scene)
Ends the specified scene.
Definition SceneAttorney.h:60
static void Delete()
Deletes the current scene.
Definition SceneAttorney.h:31
static void InitializeScene(Scene *scene)
Initializes the specified scene.
Definition SceneAttorney.h:37
static void ChangeScene(Scene *scene)
Changes the current scene to the specified scene.
Definition SceneAttorney.h:66
static void Draw(Scene *scene)
Draws the specified scene.
Definition SceneAttorney.h:54
static void Update(Scene *scene)
Updates the specified scene.
Definition SceneAttorney.h:43
Provides access to the registration related functions of Scene.
Definition SceneAttorney.h:74
static void SubmitCommand(CommandBase *cmd)
Submits a command to the current scene.
Definition SceneAttorney.h:159
static void Register(Inputable *in, AZUL_MOUSE m, EventType e)
Registers the specified inputable object in the current scene.
Definition SceneAttorney.h:144
static void Deregister(Inputable *in, AZUL_MOUSE m, EventType e)
Deregisters the specified inputable object from the current scene.
Definition SceneAttorney.h:152
static void Deregister(Drawable *dr)
Deregisters the specified drawable object from the current scene.
Definition SceneAttorney.h:105
static void Deregister(Updatable *up)
Deregisters the specified updatable object from the current scene.
Definition SceneAttorney.h:93
static void Register(Alarmable *al, AlarmableManager::ALARM_ID id, float t)
Registers the specified alarmable object in the current scene.
Definition SceneAttorney.h:113
static void Register(Drawable *dr)
Registers the specified drawable object in the current scene.
Definition SceneAttorney.h:99
static void Deregister(Alarmable *al, AlarmableManager::ALARM_ID id)
Deregisters the specified alarmable object from the current scene.
Definition SceneAttorney.h:120
static void Register(Updatable *up)
Registers the specified updatable object in the current scene.
Definition SceneAttorney.h:87
static void Deregister(Inputable *in, AZUL_KEY k, EventType e)
Deregisters the specified inputable object from the current scene.
Definition SceneAttorney.h:136
static void Register(Inputable *in, AZUL_KEY k, EventType e)
Registers the specified inputable object in the current scene.
Definition SceneAttorney.h:128
static CollisionManager * GetCollisionManager()
Gets the collision manager for the current scene.
Definition SceneAttorney.h:165
Provides controlled access to the Scene class for specific classes.
Definition SceneAttorney.h:15
Represents a scene in the engine.
Definition Scene.h:32
virtual void SceneEnd()=0
Ends the scene. Defined by the user.
CollisionManager * GetCollisionManager()
Gets the collision manager for the scene.
Definition Scene.cpp:133
void SubmitCommand(CommandBase *cmd)
Submits a command to the scene.
Definition Scene.cpp:128
void Register(Updatable *up)
Registers an updatable GameObject.
Definition Scene.cpp:78
void Draw()
Draws the scene.
Definition Scene.cpp:148
void Update()
Updates the scene. Specifically, the broker and managers other than draw.
Definition Scene.cpp:138
virtual void Initialize()=0
Initializes the scene. Defined by the user.
void Deregister(Updatable *up)
Deregisters an updatable GameObject.
Definition Scene.cpp:83
static void ChangeScene(Scene *scene)
Changes the current scene to the specified scene.
Definition SceneManager.cpp:45
static void Delete()
Deletes the SceneManager instance.
Definition SceneManager.cpp:19
static Scene * GetCurrentScene()
Gets the current scene.
Definition SceneManager.cpp:31
static void UpdateScene()
Updates the current scene.
Definition SceneManager.h:77