A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Scene.hh
1#pragma once
2
3#include <Common.hh>
4
5namespace EGG {
6
7class SceneManager;
8
16class Scene : Disposer {
17public:
18 /*------------*
19 Lifecycle
20 *------------*/
21
22 Scene();
23 virtual ~Scene();
24
25 /*----------*
26 Virtual
27 *----------*/
28
29 virtual void calc() {}
30 virtual void enter() {}
31 virtual void exit() {}
32 virtual void reinit() {}
33 virtual void incoming_childDestroy() {}
34 virtual void outgoing_childCreate() {}
35
37 void setParent(Scene *parent) {
38 m_parent = parent;
39 }
40
41 void setChild(Scene *child) {
42 m_child = child;
43 }
44
45 void setId(int id) {
46 m_id = id;
47 }
48
49 void setSceneMgr(SceneManager *sceneMgr) {
50 m_sceneMgr = sceneMgr;
51 }
53
55 [[nodiscard]] Heap *heap() const {
56 return m_heap;
57 }
58
59 [[nodiscard]] Scene *parent() const {
60 return m_parent;
61 }
62
63 [[nodiscard]] Scene *child() const {
64 return m_child;
65 }
66
67 [[nodiscard]] int id() const {
68 return m_id;
69 }
70
71 [[nodiscard]] SceneManager *sceneMgr() const {
72 return m_sceneMgr;
73 }
75
76protected:
77 /*-----------*
78 Members
79 *-----------*/
80
81 Heap *m_heap;
82 Scene *m_parent;
83 Scene *m_child;
84 int m_id;
85 SceneManager *m_sceneMgr;
86};
87
88} // namespace EGG
This header houses common data types such as our integral types and enums.
An interface for ensuring certain structures and classes are destroyed with the heap.
Definition Disposer.hh:11
A high-level representation of a memory heap for managing dynamic memory allocation....
Definition Heap.hh:16
Manages the scene stack and transitions between scenes.
EGG core library.
Definition Archive.cc:6
Pertains to scene handling.
Definition GameScene.cc:8