A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
ItemDirector.hh
1#pragma once
2
3#include "game/item/KartItem.hh"
4
5#include <span>
6
7namespace Host {
8
9class Context;
10
11} // namespace Host
12
14namespace Item {
15
18 friend class Host::Context;
19
20public:
21 void init();
22 void calc();
23
24 [[nodiscard]] KartItem &kartItem(size_t idx) {
25 ASSERT(idx < m_karts.size());
26 return m_karts[idx];
27 }
28
29 static ItemDirector *CreateInstance();
30 static void DestroyInstance();
31
32 [[nodiscard]] static ItemDirector *Instance() {
33 return s_instance;
34 }
35
36private:
38 ~ItemDirector() override;
39
40 std::span<KartItem> m_karts;
41
42 static ItemDirector *s_instance;
43};
44
45} // namespace Item
An interface for ensuring certain structures and classes are destroyed with the heap.
Definition Disposer.hh:11
Contexts can be used to restore a previous memory state for the current session.
Definition Context.hh:59
State management for item usage.
Definition KartItem.hh:13
Represents the host application.
Definition HeapCommon.hh:9
Pertains to item handling.