- various compilations fixes for Symbian

- small cleanups of the TestSuite and Player classes
This commit is contained in:
Xawotihs
2011-09-19 19:49:45 +00:00
parent 180462f73c
commit bb65d2dc12
9 changed files with 59 additions and 56 deletions

View File

@@ -389,7 +389,7 @@ public:
int triggerOnEventImpl(WEvent * event)
{
//general restrictions
if (opponentPoisoned && !source->controller()->opponent()->isPoisoned)
if (opponentPoisoned && !source->controller()->opponent()->isPoisoned())
return 0;
if (sourceUntapped && source->isTapped() == 1)
return 0;

View File

@@ -28,7 +28,6 @@ public:
JQuadPtr mAvatar;
int playMode;
bool nomaxhandsize;
bool isPoisoned;
MTGPlayerCards * game;
MTGDeck * mDeck;
string deckFile;
@@ -56,6 +55,7 @@ public:
int loseLife(int value);
int gainOrLoseLife(int value);
bool isPoisoned() {return (poisonCount > 0);}
int poisoned();
int damaged();
int prevented();

View File

@@ -59,45 +59,52 @@ public:
class TestSuite
{
public:
MTGAllCards* collection;
int summoningSickness;
bool forceAbility;
int gameType;
float timerLimit;
unsigned int seed;
int aiMaxCalls;
int currentAction;
TestSuiteState initState;
private:
int currentfile;
int nbfiles;
string files[1024];
TestSuiteState endState;
TestSuiteActions actions;
string files[1024];
int nbfiles;
int currentfile;
int nbFailed, nbTests, nbAIFailed, nbAITests;
bool forceAbility;
int summoningSickness;
int load(const char * filename);
TestSuite(const char * filename,MTGAllCards* _collection);
void cleanup();
public:
/* but only used by the testsuite classes */
float timerLimit;
int aiMaxCalls;
int currentAction;
TestSuiteState initState;
string getNextAction();
MTGPlayerCards * buildDeck(int playerId);
Interruptible * getActionByMTGId(int mtgid);
int assertGame();
public:
int gameType;
unsigned int seed;
int nbFailed, nbTests, nbAIFailed, nbAITests;
TestSuite(const char * filename);
void initGame();
void pregameTests();
int assertGame();
MTGPlayerCards * buildDeck(int playerId);
string getNextAction();
Interruptible * getActionByMTGId(int mtgid);
int loadNext();
void cleanup();
static int Log(const char * text);
};
class TestSuiteAI:public AIPlayerBaka
{
public:
TestSuite * suite;
private:
MTGCardInstance * getCard(string action);
float timer;
TestSuite * suite;
public:
TestSuiteAI(TestSuite * suite, int playerId);
virtual int Act(float dt);
MTGCardInstance * getCard(string action);
virtual int displayStack();
};