Files
wagic/projects/mtg/include/AbilityParser.h
wagic.the.homebrew 6825082d6d - Add a simple macro system for auto lines (the goal is to help mostly with repetitive card auto lines such as the ones we have in MotD mod) Check the MotD mod for examples.
-- 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
2011-10-15 16:19:29 +00:00

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