class
cGameModeManagerThe implementation of IGameModeManager; this should only be used for extending and detouring.
Base classes
- class IGameModeManager
- A manager that takes care of game modes; check IGameMode for more information.
- class IMessageListener
- An interface that can receive messages sent through the app.
- class IVirtual
- A default interface that provides a virtual destructor, it should only be used internally.
Public types
- struct ModeEntry
Constructors, destructors, conversion operators
- cGameModeManager()
- ~cGameModeManager() virtual
Public functions
-
auto HandleMessage(uint32_
t messageID, void* msg) -> bool override - Called every time a message is received.
- auto AddRef() -> int override
- auto Release() -> int override
- auto Initialize() -> bool override
- auto Dispose() -> bool override
- auto func14h() -> bool override
- auto InitializeModes() -> bool override
- Calls the IGameMode::
Initialize() method on all the modes in this manager. - auto ClearActiveMode() -> bool override
- Sets the active game mode to nullptr.
-
auto AddGameMode(IGameMode* pMode,
uint32_
t modeID, const char* pName) -> void override - Adds the given game mode to this manager under the modeID specified.
-
auto RemoveGameMode(uint32_
t modeID) -> bool override - Removes the game mode with the ID specified from this manager.
-
auto SetActiveMode(uint32_
t modeID) -> bool override - Sets the active game mode to be the one with the specified ID.
- auto GetActiveMode() -> IGameMode* override
- Returns the game mode that is currently in action.
-
auto GetGameMode(uint32_
t modeID) -> IGameMode* override - Gets the game mode in this manager with the specified ID.
-
auto GetModeIDAt(size_
t index) -> uint32_ t override - Gets the modeID at the specified index.
-
auto GetActiveModeID() -> uint32_
t override - Gets the modeID of the currently active IGameMode.
-
auto GetModeCount() -> size_
t override - Gets the number of game modes contained in this manager.
-
auto SetActiveModeAt(size_
t index) -> bool override - Sets the active game mode to be the one at the specified index.
-
auto GetGameModeAt(size_
t index) -> IGameMode* override - Gets the IGameMode at the specified index.
- auto func48h(int) -> int override
- auto SetActiveModeByName(const char* pName) -> bool override
- Sets the active game mode to be the one with the specified name.
- auto GetCameraManager() -> ICameraManager* override
- Gets the ICameraManager instance used in this mode manager, and that manages the active camera of the active game mode.
- auto SetViewer(cViewer* pViewer) -> void override
- Sets the Viewer instance that is used for rendering the main game frame.
- auto GetViewer() -> cViewer* override
- Returns the Viewer instance that is being used for rendering the main game frame.
Public variables
- int mnRefCount
- bool field_10
- eastl::vector<ModeEntry> mEntries
- int mnActiveIndex
- ICameraManagerPtr mpCameraMgr
- cViewer* mpViewer
Function documentation
bool App:: cGameModeManager:: HandleMessage(uint32_ t messageID,
void* msg) override
Called every time a message is received.
Parameters | |
---|---|
messageID | The ID of the message received. |
msg | The data of the message received, it might be nullptr. |
Returns | Whether the message was handled or not. |
Only the messages with an ID this listener signed up for will call this event.
bool App:: cGameModeManager:: ClearActiveMode() override
Sets the active game mode to nullptr.
Returns | True if there was an active context, false otherwise. |
---|
The IGameMode::
void App:: cGameModeManager:: AddGameMode(IGameMode* pMode,
uint32_ t modeID,
const char* pName) override
Adds the given game mode to this manager under the modeID specified.
Parameters | |
---|---|
pMode | The IGameMode to add. |
modeID | The ID that uniquely identifies this game mode, and that can be used to access it. |
pName | The name of this mode. |
bool App:: cGameModeManager:: RemoveGameMode(uint32_ t modeID) override
Removes the game mode with the ID specified from this manager.
Parameters | |
---|---|
modeID | The ID of the mode to remove. |
Returns | True if the game mode was removed, false if it was not in this manager. |
This will call the IGameMode::
bool App:: cGameModeManager:: SetActiveMode(uint32_ t modeID) override
Sets the active game mode to be the one with the specified ID.
Parameters | |
---|---|
modeID | The ID of the game mode to set as active. |
Returns | True if the mode was found and set active, false otherwise. |
If there's already an active mode, the method IGameMode::
IGameMode* App:: cGameModeManager:: GetGameMode(uint32_ t modeID) override
Gets the game mode in this manager with the specified ID.
Parameters | |
---|---|
modeID | The ID of the mode. |
Returns | The IGameMode with that ID, or nullptr if there is none. |
uint32_ t App:: cGameModeManager:: GetModeIDAt(size_ t index) override
Gets the modeID at the specified index.
Parameters | |
---|---|
index | The index of the game modes array. |
Returns | The ID of the game mode at that index, or 0 if the index is out of bounds. |
uint32_ t App:: cGameModeManager:: GetActiveModeID() override
Gets the modeID of the currently active IGameMode.
Returns | The ID of the active game mode, or 0 if no mode is active. |
---|
bool App:: cGameModeManager:: SetActiveModeAt(size_ t index) override
Sets the active game mode to be the one at the specified index.
Parameters | |
---|---|
index | The index of the game mode to set as active. |
Returns | True if the mode was found and set active, false otherwise. |
If there's already an active mode, the method IGameMode::
IGameMode* App:: cGameModeManager:: GetGameModeAt(size_ t index) override
Gets the IGameMode at the specified index.
Parameters | |
---|---|
index | The index of the game modes array. |
Returns | A pointer to the IGameMode at that index, or nullptr if the index is out of bounds. |
bool App:: cGameModeManager:: SetActiveModeByName(const char* pName) override
Sets the active game mode to be the one with the specified name.
Parameters | |
---|---|
pName | The name of the game mode to set as active. |
Returns | True if the mode was found and set active, false otherwise. |
If there's already an active mode, the method IGameMode::