in this commit i added a creature subtype specific vector, added a couple variables for new abilities, and a sort for the creature variable to avoid the long lag out everytime we play a card or ability that needs this vector.

This commit is contained in:
omegablast2002@yahoo.com
2012-03-13 16:32:26 +00:00
parent 97bd418aac
commit 39e8bd1f30
6 changed files with 61 additions and 12 deletions

View File

@@ -472,6 +472,7 @@ public:
void addAbilities(int _id, Spell * spell);
MTGAbility * parseUpkeepAbility(string s = "", MTGCardInstance * card = NULL, Spell * spell = NULL, int restrictions = 0, int id = -1);
MTGAbility * parsePhaseActionAbility(string s = "", MTGCardInstance * card = NULL, Spell * spell = NULL,MTGCardInstance * target = NULL, int restrictions = 0, int id = -1);
MTGAbility * parseChooseActionAbility(string s = "", MTGCardInstance * card = NULL, Spell * spell = NULL,MTGCardInstance * target = NULL, int restrictions = 0, int id = -1);
};

View File

@@ -88,6 +88,9 @@ public:
bool graveEffects;
bool exileEffects;
bool suspended;
int chooseacolor;
string chooseasubtype;
int coinSide;//1 = tails
int stillInUse();
int didattacked;
@@ -104,6 +107,7 @@ public:
MTGCardInstance * previous;
MTGCardInstance * next;
int doDamageTest;
bool skipDamageTestOnce;
int summoningSickness;
ManaCost reducedCost;
ManaCost increasedCost;
@@ -149,6 +153,7 @@ public:
int canBlock(MTGCardInstance * opponent);
int canAttack();
int isAttacker();
Targetable * isAttacking;
MTGCardInstance * isDefenser();
int initAttackersDefensers();
MTGCardInstance * getNextOpponent(MTGCardInstance * previous=NULL);

View File

@@ -146,6 +146,9 @@ public:
static const vector<string>& getValuesById() {
return instance->subtypesList.getValuesById();
};
static const vector<string>& getCreatureValuesById() {
return instance->subtypesList.getCreatureValuesById();
};
static bool isSubtypeOfType(unsigned int subtype, unsigned int type) {
return instance->subtypesList.isSubtypeOfType(subtype, type);
};
@@ -159,6 +162,15 @@ public:
return instance->subtypesList.isSubType(type);
};
static void sortSubtypeList()
{
return instance->subtypesList.sortSubTypes();
}
static int findSubtypeId(string value){
return instance->subtypesList.find(value,false);
}
static void loadInstance();
static void unloadAll();
static inline MTGAllCards* getInstance() { return instance; };

View File

@@ -38,6 +38,7 @@ protected:
vector<string> valuesById;
vector<unsigned int> subtypesToType;
public:
vector<string> subtypesCreature;
Subtypes();
int find(string subtype, bool forceAdd = true);
string find(unsigned int id);
@@ -45,8 +46,11 @@ public:
bool isSuperType(unsigned int type);
bool isType(unsigned int type);
bool isSubType(unsigned int type);
void sortSubTypes();
int add(string value, unsigned int parentType);
const vector<string>& getValuesById();
const vector<string>& getCreatureValuesById();
const map<string, int>& getValuesByMap();
};
#endif