- Removed "isClone" flag. This flag was error prone. The "core" classes now have decent copy constructors, and ideally long term we should create copy constructors for the abilities that have additional pointers in them.

-- The test suite passes but this is a big change. I might have introduced some memory leaks or bugs. I might have fixed some bugs, too
This commit is contained in:
wagic.the.homebrew
2011-07-27 14:31:27 +00:00
parent a26125ee4c
commit ef5e011e23
14 changed files with 520 additions and 610 deletions
+9 -4
View File
@@ -42,6 +42,8 @@ using std::map;
class MTGAbility : public ActionElement
{
private:
ManaCost* mCost;
protected:
char menuText[50];
@@ -104,14 +106,10 @@ public:
};
int parseCastRestrictions(MTGCardInstance* card, Player* player, string restrictions, string otherRestrictions);
int allowedToCast(MTGCardInstance* card, Player* player);
int allowedToAltCast(MTGCardInstance* card, Player* player);
bool oneShot;
int forceDestroy;
int forcedAlive;
bool canBeInterrupted;
ManaCost* cost;
ManaCost* alternative;
ManaCost* BuyBack;
ManaCost* FlashBack;
@@ -124,10 +122,17 @@ public:
int naType;
int abilitygranted;
MTGCardInstance * source;
int parseCastRestrictions(MTGCardInstance* card, Player* player, string restrictions, string otherRestrictions);
int allowedToCast(MTGCardInstance* card, Player* player);
int allowedToAltCast(MTGCardInstance* card, Player* player);
MTGAbility(int id, MTGCardInstance * card);
MTGAbility(int id, MTGCardInstance * _source, Targetable * _target);
MTGAbility(const MTGAbility& copyFromMe);
virtual int testDestroy();
virtual ~MTGAbility();
ManaCost * getCost() {return mCost;};
void setCost(ManaCost * cost, bool forceDelete = 0);
virtual void Render()
{