2013-05-23 11:10:39 +00:00
|
|
|
// Rough and ready CwCheats implementation, disabled by default.
|
|
|
|
// Will not enable by default until the TOOD:s have been addressed.
|
2013-05-16 20:42:25 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <iostream>
|
|
|
|
#include <sstream>
|
2013-05-23 11:10:39 +00:00
|
|
|
|
|
|
|
#include "base/basictypes.h"
|
|
|
|
#include "Core/MemMap.h"
|
2013-05-16 20:42:25 +00:00
|
|
|
|
2013-05-18 04:49:44 +00:00
|
|
|
void __CheatInit();
|
|
|
|
void __CheatShutdown();
|
2013-05-16 20:42:25 +00:00
|
|
|
|
2013-05-23 11:10:39 +00:00
|
|
|
std::vector<std::string> makeCodeParts(std::string l);
|
2013-05-16 20:42:25 +00:00
|
|
|
|
2013-05-18 22:04:01 +00:00
|
|
|
class CWCheatEngine {
|
2013-05-16 20:42:25 +00:00
|
|
|
public:
|
2013-05-18 22:04:01 +00:00
|
|
|
CWCheatEngine();
|
2013-05-23 11:10:39 +00:00
|
|
|
std::string String();
|
|
|
|
void AddCheatLine(std::string& line);
|
|
|
|
std::vector<std::string> GetCodesList();
|
2013-05-18 04:49:44 +00:00
|
|
|
|
|
|
|
void Exit();
|
|
|
|
void Run();
|
2013-05-23 11:10:39 +00:00
|
|
|
std::string GetNextCode();
|
2013-05-16 20:42:25 +00:00
|
|
|
|
2013-05-23 11:10:39 +00:00
|
|
|
private:
|
|
|
|
void SkipCodes(int count);
|
|
|
|
void SkipAllCodes();
|
|
|
|
int GetAddress(int value);
|
2013-05-16 20:42:25 +00:00
|
|
|
|
2013-05-23 11:10:39 +00:00
|
|
|
static uint64_t const serialVersionUID = 6791588139795694296ULL;
|
|
|
|
static const int cheatsThreadSleepMillis = 5;
|
2013-05-16 20:42:25 +00:00
|
|
|
|
2013-05-23 11:10:39 +00:00
|
|
|
bool cheatsOn;
|
|
|
|
std::vector<std::string> codes;
|
|
|
|
int currentCode;
|
|
|
|
bool exit2;
|
|
|
|
};
|