A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Context.hh
1#pragma once
2
3#include "Common.hh"
4
5#include <filesystem>
6#include <functional>
7#include <optional>
8
9class KSystem;
10
11namespace Abstract::Memory {
12class MEMList;
13} // namespace Abstract::Memory
14
15namespace EGG {
16class Archive;
17class Heap;
18class SceneManager;
19} // namespace EGG
20
21namespace Field {
22class BoxColManager;
23class CollisionDirector;
24class CourseColMgr;
25class ObjectCollisionBase;
26class ObjectDirector;
27class ObjectDrivableDirector;
28class RailManager;
29} // namespace Field
30
31namespace Item {
32class ItemDirector;
33} // namespace Item
34
35namespace Kart {
36class KartObjectManager;
37class KartParamFileManager;
38} // namespace Kart
39
40namespace System {
41class CourseMap;
42class KPadDirector;
43class KPadHostController;
44class RaceConfig;
45typedef std::function<void(RaceConfig *, void *)> InitCallback;
46class RaceInputState;
47class RaceManager;
48class ResourceManager;
49class KSystem;
50} // namespace System
51
52namespace Host {
53
59class Context {
60public:
61 Context();
62 Context(const Context &c);
63 Context(Context &&c);
64 ~Context();
65
66 Context &operator=(const Context &rhs);
67 Context &operator=(Context &&rhs);
68
69 bool operator==(const Context &rhs) const;
70
71 static void SetActiveContext(const Context &rhs);
72
73private:
74 struct Pointers {
76 Abstract::Memory::MEMList m_archiveList;
78 EGG::Heap *m_currentHeap;
79 EGG::Heap *m_heapForCreateScene;
80 Field::BoxColManager *m_boxColMgr;
82 Field::CourseColMgr *m_courseColMgr;
83 Field::ObjectDirector *m_objDir;
84 Field::ObjectDrivableDirector *m_objDrivableDir;
85 Field::RailManager *m_railMgr;
86 Item::ItemDirector *m_itemDir;
87 Kart::KartObjectManager *m_kartObjMgr;
88 Kart::KartParamFileManager *m_paramFileMgr;
89 System::CourseMap *m_courseMap;
90 System::KPadDirector *m_padDir;
91 System::RaceConfig *m_raceConfig;
92 System::InitCallback m_onInitCallback;
93 void *m_onInitCallbackArg;
94 System::RaceManager *m_raceMgr;
96 };
97
98 void *m_contextMemory;
99 Pointers m_ptrs;
100};
101
102} // namespace Host
This header houses common data types such as our integral types and enums.
A high-level representation of a memory heap for managing dynamic memory allocation....
Definition Heap.hh:22
Spatial indexing manager for entities with dynamic collision.
Manages the caching of colliding KCL triangles and exposes queries for collision checks.
Manager for course KCL interactions.
Contexts can be used to restore a previous memory state for the current session.
Definition Context.hh:59
Base interface for a Kinoko system.
Definition KSystem.hh:8
Responsible for the lifecycle and calculation of KartObjects.
Abstraction for the process of retrieving kart parameters from files.
Contains course metadata, notably the starting position.
Definition CourseMap.hh:32
The highest level abstraction for controller processing.
Initializes the player with parameters specified in the provided ghost file.
Definition RaceConfig.hh:21
Manages the timers that track the stages of a race. Also acts as the interface between the physics en...
Highest level abstraction for archive management and subsequent file retrieval.
EGG core library.
Definition Archive.cc:6
Pertains to collision.
Represents the host application.
Definition HeapCommon.hh:9
Pertains to item handling.
Pertains to kart-related functionality.
High-level handling for generic system operations, such as input reading, race configuration,...
Definition CourseMap.cc:5
Intrusive doubly-linked list. Links are placed within the corresponding object.
Definition List.hh:14