Reducing the memory footprint: reworked the concept of 'colors' in CardPrimitives. What used to be an array of ints (ie 28 bytes) is now contained in a single byte, we use bit masking to support setting multiple colors on this variable. This also eliminates a lot of silly loops for setting colors in the code - now it's a straight byte copy.
Also thrown in are a couple of string to const string& conversions.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
#define CD_OR 1
|
||||
#define CD_AND 2
|
||||
#define CD_NOT 3
|
||||
|
||||
enum ENUM_COMPARISON_MODES
|
||||
{
|
||||
@@ -23,10 +24,12 @@ enum ENUM_COMPARISON_MODES
|
||||
COMPARISON_UNEQUAL
|
||||
};
|
||||
|
||||
class CardDescriptor: public MTGCardInstance{
|
||||
class CardDescriptor: public MTGCardInstance
|
||||
{
|
||||
protected:
|
||||
MTGCardInstance * match_or(MTGCardInstance * card);
|
||||
MTGCardInstance * match_and(MTGCardInstance * card);
|
||||
MTGCardInstance * match_or(MTGCardInstance * card);
|
||||
MTGCardInstance * match_and(MTGCardInstance * card);
|
||||
MTGCardInstance * match_not(MTGCardInstance * card);
|
||||
bool valueInRange(int comparisonMode, int value, int criterion);
|
||||
public:
|
||||
int mode;
|
||||
|
||||
Reference in New Issue
Block a user