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 Kinoko {
8
9namespace Host {
10
11class Context;
12
13} // namespace Host
14
16namespace Item {
17
20 friend class Host::Context;
21
22public:
23 void init();
24 void calc();
25
26 [[nodiscard]] KartItem &kartItem(size_t idx) {
27 ASSERT(idx < m_karts.size());
28 return m_karts[idx];
29 }
30
31 static ItemDirector *CreateInstance();
32 static void DestroyInstance();
33
34 [[nodiscard]] const ItemInventory &itemInventory(s16 idx) const {
35 return m_karts[idx].inventory();
36 }
37
38 [[nodiscard]] static ItemDirector *Instance() {
39 return s_instance;
40 }
41
42private:
44 ~ItemDirector() override;
45
47
48 static ItemDirector *s_instance;
49};
50
51} // namespace Item
52
53} // namespace Kinoko
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:71
State management for item usage.
Definition KartItem.hh:13
A contiguous storage container that manages the lifecycle of a buffer of a given size.
Definition Types.hh:29