-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathCheatManager.cpp
More file actions
75 lines (68 loc) · 3.29 KB
/
CheatManager.cpp
File metadata and controls
75 lines (68 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/****************************************************************************
* Copyright (C) 2018 Eric Mor
*
* This file is part of Spore ModAPI.
*
* Spore ModAPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include <Spore\App\cCheatManager.h>
#include <Spore\ArgScript\LambdaParser.h>
namespace App
{
auto_STATIC_METHOD_(ICheatManager, ICheatManager*, Get);
#ifndef MODAPI_DLL_EXPORT
auto_METHOD_VIRTUAL_(cCheatManager, cCheatManager, bool, Initialize);
auto_METHOD_VIRTUAL_(cCheatManager, cCheatManager, bool, Dispose);
auto_METHOD_VIRTUAL_VOID_(cCheatManager, cCheatManager, func14h);
auto_METHOD_VIRTUAL_VOID(cCheatManager, cCheatManager, AddCheat, Args(const char* pString, ArgScript::ICommand* parser, bool bNotify), Args(pString, parser, bNotify));
auto_METHOD_VIRTUAL_VOID(cCheatManager, cCheatManager, RemoveCheat, Args(const char* pString), Args(pString));
auto_METHOD_VIRTUAL(cCheatManager, cCheatManager, bool, ProcessLine, Args(const char* pString), Args(pString));
auto_METHOD_VIRTUAL_(cCheatManager, cCheatManager, int, func24h);
auto_METHOD_VIRTUAL(cCheatManager, cCheatManager, ArgScript::ICommand*, GetCheat, Args(const char* pKeyword), Args(pKeyword));
auto_METHOD_VIRTUAL(cCheatManager, cCheatManager, size_t, GetKeywords, Args(const char* pPattern, eastl::vector<const char*> dst), Args(pPattern, dst));
auto_METHOD_VIRTUAL_VOID(cCheatManager, cCheatManager, func30h, Args(Object* arg_0), Args(arg_0));
auto_METHOD_VIRTUAL_VOID(cCheatManager, cCheatManager, func34h, Args(Object* arg_0), Args(arg_0));
auto_METHOD_VIRTUAL_(cCheatManager, cCheatManager, ArgScript::FormatParser*, GetArgScript);
auto_METHOD_VIRTUAL_VOID(cCheatManager, cCheatManager, ActivateConsole, Args(int arg_0), Args(arg_0));
auto_METHOD_VIRTUAL_VOID(cCheatManager, cCheatManager, DeactivateConsole, Args(int arg_0), Args(arg_0));
auto_METHOD_VIRTUAL_VOID(cCheatManager, cCheatManager, ToggleConsole, Args(int arg_0), Args(arg_0));
auto_METHOD_VIRTUAL_(cCheatManager, cCheatManager, bool, func48h);
auto_METHOD_VIRTUAL_VOID(cCheatManager, cCheatManager, func4Ch, Args(bool arg_0), Args(arg_0));
cCheatManager::cCheatManager()
: mnRefCount(0)
, mCheats()
, mNotifyCheats()
, mpArgScript(nullptr)
, field_48()
, field_68(true)
{
}
int cCheatManager::AddRef()
{
return ++mnRefCount;
}
int cCheatManager::Release()
{
if (--mnRefCount == 0)
{
delete this;
}
return mnRefCount;
}
void ICheatManager::AddCheat(const char* pKeyword, ArgScript::ParseLine_t pParseLine, ArgScript::GetDescription_t pGetDescription, bool bNotify)
{
AddCheat(pKeyword, reinterpret_cast<ArgScript::ICommand*>(new ArgScript::LambdaParser(pParseLine, pGetDescription)), bNotify);
}
#endif
}