App::cCheatManager class

The implementation of ICheatManager; this should only be used for extending and detouring.

Base classes

class ICheatManager
This manager is used to control the available cheats in the game, and the cheat console.
class IVirtual
A default interface that provides a virtual destructor, it should only be used internally.

Protected types

using CheatMap_t = map<string, intrusive_ptr<ArgScript::IParser>>

Protected variables

int mnRefCount
CheatMap_t mCheats
set<string> mNotifyCheats
ArgScript::FormatParser* mpArgScript
set<intrusive_ptr<Object>> field_48
bool field_68

Private functions

~cCheatManager() private virtual
auto AddRef() -> int override
auto Release() -> int override
auto Initialize() -> bool override
auto Dispose() -> bool override
void func14h() override
void AddCheat(const char* pString, ArgScript::ICommand* pParser, bool bNotify) override
Adds a cheat to this manager.
void RemoveCheat(const char* pString) override
Removes the cheat that is invoked with the given keyword from this manager.
auto ProcessLine(const char* pString) -> bool override
Called every time a line is submitted to the console.
auto func24h() -> int override
auto GetCheat(const char* pKeyword) -> ArgScript::ICommand* override
Returns the ArgScript::ICommand that is operating behind the requested cheat.
auto GetKeywords(const char* pPattern, vector<const char*> dst) -> size_t override
Gets all the cheat keywords in this manager that match the given pattern.
void func30h(Object*) override
void func34h(Object*) override
auto GetArgScript() -> ArgScript::FormatParser* override
Returns the ArgScript::FormatParser instance that this manager is using.
void func3Ch(int) override
void func40h(int) override
void func44h(int) override
auto func48h() -> bool override
void func4Ch(bool) override

Function documentation

void App::cCheatManager::AddCheat(const char* pString, ArgScript::ICommand* pParser, bool bNotify) override private

Adds a cheat to this manager.

Parameters
pString The keyword that is used to invoke the cheat. This is case insensitive and it can't contain whitespaces.
pParser The ArgScript::ICommand that represents this cheat.
bNotify [Optional] If true, a kMsgCheatInvoked message will be sent when the cheat is invoked.

The cheat is just an ArgScript::ICommand object; the ArgScript::ICommand::ParseLine() function will be called when the cheat is invoked.

void App::cCheatManager::RemoveCheat(const char* pString) override private

Removes the cheat that is invoked with the given keyword from this manager.

Parameters
pString The keyword used to invoke the cheat. This is case insensitive and it can't contain whitespaces.

bool App::cCheatManager::ProcessLine(const char* pString) override private

Called every time a line is submitted to the console.

Parameters
pString The text contents of the line.
Returns Whether the line was correctly processed or not.

ArgScript::ICommand* App::cCheatManager::GetCheat(const char* pKeyword) override private

Returns the ArgScript::ICommand that is operating behind the requested cheat.

Parameters
pKeyword The keyword used to invoke the cheat.

size_t App::cCheatManager::GetKeywords(const char* pPattern, vector<const char*> dst) override private

Gets all the cheat keywords in this manager that match the given pattern.

Parameters
pPattern The pattern keywords must match in order to be added to the vector.
dst A const char* vector where the keywords will be added.
Returns The number of keywords added.

The pattern uses the character '?' to allow any character, and '*' to allow any sequence of characters.