Get rid of two more define groups.

This commit is contained in:
Tobias Loose
2013-11-17 20:22:03 +01:00
parent e1213d1c1f
commit 5419d87e4e
5 changed files with 20 additions and 19 deletions

View File

@@ -41,10 +41,6 @@ class DamageStack;
class ManaCost; class ManaCost;
class TargetChooser; class TargetChooser;
#define ACTIONSTACK_STANDARD 0
#define ACTIONSTACK_TARGET 1
class Interruptible: public PlayGuiObject, public Targetable class Interruptible: public PlayGuiObject, public Targetable
{ {
public: public:
@@ -183,6 +179,11 @@ public:
class ActionStack :public GuiLayer class ActionStack :public GuiLayer
{ {
public: public:
enum ActionStackMode{
ACTIONSTACK_STANDARD = 0,
ACTIONSTACK_TARGET = 1
};
typedef enum typedef enum
{ {
NOT_DECIDED = 0, NOT_DECIDED = 0,
@@ -204,7 +205,7 @@ protected:
InterruptDecision interruptDecision[2]; InterruptDecision interruptDecision[2];
float timer; float timer;
int currentState; int currentState;
int mode; ActionStackMode mode;
int checked; int checked;
ATutorialMessage* currentTutorial; ATutorialMessage* currentTutorial;
int interruptBtnXOffset, noBtnXOffset, noToAllBtnXOffset, interruptDialogWidth; int interruptBtnXOffset, noBtnXOffset, noToAllBtnXOffset, interruptDialogWidth;

View File

@@ -9,9 +9,6 @@
#include "MTGGameZones.h" #include "MTGGameZones.h"
#include "Counters.h" #include "Counters.h"
#define CD_OR 1
#define CD_AND 2
enum ENUM_COMPARISON_MODES enum ENUM_COMPARISON_MODES
{ {
COMPARISON_NONE = 0, // Needs to remain 0 for quick if(comparison_mode) checks COMPARISON_NONE = 0, // Needs to remain 0 for quick if(comparison_mode) checks
@@ -31,7 +28,12 @@ class CardDescriptor: public MTGCardInstance
MTGCardInstance * match_not(MTGCardInstance * card); MTGCardInstance * match_not(MTGCardInstance * card);
bool valueInRange(int comparisonMode, int value, int criterion); bool valueInRange(int comparisonMode, int value, int criterion);
public: public:
int mode; enum Operator{
CD_OR = 1,
CD_AND = 2
};
Operator mode;
int powerComparisonMode; int powerComparisonMode;
int toughnessComparisonMode; int toughnessComparisonMode;
int manacostComparisonMode; int manacostComparisonMode;

View File

@@ -74,8 +74,7 @@ AIHint::AIHint(string _line)
if(action.find( "combo ") != string::npos) if(action.find( "combo ") != string::npos)
{ {
string Combo = ""; string Combo = action.c_str() + 6;
Combo = action.c_str() + 6;
combos.push_back(Combo); combos.push_back(Combo);
} }

View File

@@ -96,7 +96,6 @@ int AIMomirPlayer::computeActions()
case MTG_PHASE_FIRSTMAIN: case MTG_PHASE_FIRSTMAIN:
{ {
CardDescriptor cd; CardDescriptor cd;
MTGCardInstance * card = NULL;
ManaCost * potentialMana = getPotentialMana(); ManaCost * potentialMana = getPotentialMana();
int converted = potentialMana->getConvertedCost(); int converted = potentialMana->getConvertedCost();
SAFE_DELETE(potentialMana); SAFE_DELETE(potentialMana);
@@ -106,7 +105,7 @@ int AIMomirPlayer::computeActions()
//Attempt to put land into play //Attempt to put land into play
cd.init(); cd.init();
cd.setColor(Constants::MTG_COLOR_LAND); cd.setColor(Constants::MTG_COLOR_LAND);
card = cd.match(game->hand); MTGCardInstance *card = cd.match(game->hand);
int canPutLandsIntoPlay = game->playRestrictions->canPutIntoZone(card, game->inPlay); int canPutLandsIntoPlay = game->playRestrictions->canPutIntoZone(card, game->inPlay);
if (card && (canPutLandsIntoPlay == PlayRestriction::CAN_PLAY)) if (card && (canPutLandsIntoPlay == PlayRestriction::CAN_PLAY))
{ {

View File

@@ -294,13 +294,13 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
string attribute; string attribute;
if (found2 != string::npos) if (found2 != string::npos)
{ {
cd->mode = CD_OR; cd->mode = CardDescriptor::CD_OR;
attribute = attributes.substr(0, found2); attribute = attributes.substr(0, found2);
attributes = attributes.substr(found2 + 1); attributes = attributes.substr(found2 + 1);
} }
else if (foundAnd != string::npos) else if (foundAnd != string::npos)
{ {
cd->mode = CD_AND; cd->mode = CardDescriptor::CD_AND;
attribute = attributes.substr(0, foundAnd); attribute = attributes.substr(0, foundAnd);
attributes = attributes.substr(foundAnd + 1); attributes = attributes.substr(foundAnd + 1);
} }
@@ -550,7 +550,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
else else
cd->colors = card->colors; cd->colors = card->colors;
cd->mode = CD_OR; cd->mode = CardDescriptor::CD_OR;
} }
else if( CDtype.find("types") != string::npos ) else if( CDtype.find("types") != string::npos )
{ {
@@ -572,7 +572,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
cd->removeType("creature"); cd->removeType("creature");
cd->removeType("planeswalker"); cd->removeType("planeswalker");
cd->removeType("tribal"); cd->removeType("tribal");
cd->mode = CD_OR; cd->mode = CardDescriptor::CD_OR;
} }
} }
else if (attribute.find("counter") != string::npos) else if (attribute.find("counter") != string::npos)
@@ -629,7 +629,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
{ {
cd->SetExclusionColor(cid); cd->SetExclusionColor(cid);
} }
cd->mode = CD_OR; cd->mode = CardDescriptor::CD_OR;
} }
if (attribute.find("chosencolor") != string::npos) if (attribute.find("chosencolor") != string::npos)
@@ -685,7 +685,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
} }
} }
if (nbminuses) if (nbminuses)
cd->mode = CD_AND; cd->mode = CardDescriptor::CD_AND;
typeName = typeName.substr(0, found); typeName = typeName.substr(0, found);
} }
if (cd) if (cd)