A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
RailManager.hh
1#pragma once
2
3#include "game/field/RailInterpolator.hh"
4
5#include <egg/core/Allocator.hh>
6
7#include <vector>
8
9namespace Kinoko {
10
11namespace Host {
12
13class Context;
14
15} // namespace Host
16
17namespace Field {
18
19// TODO: Inherit EGG::Disposer
20class RailManager {
21 friend class Host::Context;
22
23public:
25 [[nodiscard]] Rail *rail(size_t idx) {
26 ASSERT(idx < m_rails.size());
27 return m_rails[idx];
28 }
29
30 [[nodiscard]] const Rail *rail(size_t idx) const {
31 ASSERT(idx < m_rails.size());
32 return m_rails[idx];
33 }
35
36 static RailManager *CreateInstance();
37 static void DestroyInstance();
38
39 [[nodiscard]] static RailManager *Instance() {
40 return s_instance;
41 }
42
43private:
44 EGG_NEW_DELETE_FRIEND
45
46 RailManager();
47 ~RailManager();
48
49 void createPaths();
50
52 u16 m_totalRails;
53 u16 m_extraInterplatorCount;
54 u16 m_pointCount;
55
56 static RailManager *s_instance;
57};
58
59} // namespace Field
60
61} // namespace Kinoko
Contexts can be used to restore a previous memory state for the current session.
Definition Context.hh:71
Dynamically sized array that only allocates once.
Definition Types.hh:177
Pertains to collision.
Represents the host application.
Definition HeapCommon.hh:11