* added hashmap for all basic abilities.
* created three new utility functions that return a vector of matching abilities, colors and types
* migrated all activated ability impl into AllAbilities.cpp. Perhaps we could break AllAbilities up into separate impl files for manageability?
One for Activated abilities, another for triggers,etc
This commit is contained in:
+211
-1241
File diff suppressed because it is too large
Load Diff
@@ -217,10 +217,14 @@ class Constants
|
||||
static const char* MTGColorStrings[];
|
||||
static int _r[], _g[], _b[];
|
||||
|
||||
|
||||
static map<string,int> MTGBasicAbilitiesMap;
|
||||
static const char* MTGBasicAbilities[];
|
||||
static const char* MTGPhaseNames[];
|
||||
static const char* MTGPhaseCodeNames[];
|
||||
|
||||
static int GetBasicAbilityIndex(string mtgAbility);
|
||||
static int GetColorStringIndex(string mtgColor);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -43,6 +43,10 @@ std::vector<std::string> &split(const std::string &s, char delim, std::vector<st
|
||||
std::vector<std::string> split(const std::string &s, char delim); //splits a string with "delim" and returns a vector of strings.
|
||||
std::string wordWrap(std::string s, int width);
|
||||
|
||||
void PopulateColorIndexVector( list<int>& colors, const string& colorsString, char delimiter = ' ');
|
||||
void PopulateAbilityIndexVector( list<int>& abilities, const string& abilitiesString, char delimiter = ',');
|
||||
void PopulateSubtypesIndexVector( list<int>& subtypes, const string& subtypesString, char delimiter = ' ');
|
||||
|
||||
|
||||
int loadRandValues(string s);
|
||||
int filesize(const char * filename);
|
||||
|
||||
Reference in New Issue
Block a user