Replaced ManaCost's int array with int8_t. Shrinks ManaCost by another 24 bytes, which in turn lowers CardPrimitive's footprint by the same amount.

This commit is contained in:
wrenczes
2011-05-04 10:02:47 +00:00
parent d922d4fe06
commit 0cb8c50b39
5 changed files with 17 additions and 17 deletions
+4 -4
View File
@@ -23,7 +23,7 @@ class ManaCost
friend std::ostream& operator<<(std::ostream& out, ManaCost m);
protected:
int cost[Constants::MTG_NB_COLORS+1];
int8_t cost[Constants::MTG_NB_COLORS+1];
std::vector<ManaCostHybrid> hybrids;
@@ -55,7 +55,7 @@ public:
virtual void reinit();
void x();
int hasX();
ManaCost(int _cost[], int nb_elems = 1);
ManaCost(int8_t _cost[], int nb_elems = 1);
ManaCost();
~ManaCost();
ManaCost(ManaCost * _manaCost);
@@ -82,8 +82,8 @@ public:
int doPayExtra();
int addHybrid(int c1, int v1, int c2, int v2);
int tryToPayHybrids(std::vector<ManaCostHybrid>& _hybrids, int _nbhybrids, int diff[]);
void randomDiffHybrids(ManaCost * _cost, int diff[]);
int tryToPayHybrids(std::vector<ManaCostHybrid>& _hybrids, int _nbhybrids, int8_t diff[]);
void randomDiffHybrids(ManaCost * _cost, int8_t diff[]);
int add(ManaCost * _cost);
int remove(ManaCost * _cost);
int removeAll(int color);