-- I added an AbilityParser.cpp file, mid term goal is to move AbilityFactory there, so that MTGAbility.cpp becomes a bit less big. -- I tried to add the file reference in Makefiles, but only tested windows compilation so far - Fixed bugs related to "castRestriction" variables in MTGAbility. these variables were declared in both the parent and children classes, leading to bugs and duplicate code/content The test suite passes
26 lines
579 B
C++
26 lines
579 B
C++
#ifndef _ABILITY_PARSER_H_
|
|
#define _ABILITY_PARSER_H_
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
using std::string;
|
|
using std::vector;
|
|
using std::map;
|
|
|
|
class AutoLineMacro {
|
|
private:
|
|
string mName;
|
|
string mResult;
|
|
vector<string> mParams;
|
|
void parse(string& s);
|
|
string process(string& s);
|
|
static vector<AutoLineMacro *> gAutoLineMacros;
|
|
static map<string, bool> gAutoLineMacrosIndex;
|
|
public:
|
|
AutoLineMacro(string& s);
|
|
static void Destroy();
|
|
static bool AddMacro(string& s);
|
|
static string Process(string& s);
|
|
};
|
|
|
|
#endif |