-Fixed bug with fountain of youth
-New alternate format for decks
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-04-02 12:50:18 +00:00
parent 3e1bcbfd22
commit 5952b382a2
13 changed files with 132 additions and 56 deletions
+2
View File
@@ -35,6 +35,7 @@ class MtgSets{
static MtgSets * SetsList;
MtgSets();
int Add(const char * subtype);
int find(string value);
};
@@ -59,6 +60,7 @@ class MTGAllCards {
MTGAllCards(const char * config_file, const char * set_name);
MTGAllCards(const char * config_file, const char * set_name, TexturesCache * cache);
MTGCard * getCardById(int id);
MTGCard * getCardByName(string name);
int load(const char * config_file, const char * setName, int autoload = 1);
int countByType(const char * _type);
int countByColor(int color);
+2
View File
@@ -10,6 +10,7 @@ using std::map;
#define MTG_MAX_PLAYER_CARDS 100
class MTGAllCards;
class MTGDeck;
class MTGCardInstance;
class Player;
@@ -88,6 +89,7 @@ class MTGPlayerCards {
MTGAllCards * collection;
MTGPlayerCards(MTGAllCards * _collection, int * idList, int idListSize);
MTGPlayerCards(MTGAllCards * _collection, MTGDeck * deck);
~MTGPlayerCards();
void initGame(int shuffle = 1, int draw = 1);
void setOwner(Player * player);
+8 -4
View File
@@ -37,16 +37,19 @@ class TestSuitePlayerData{
class TestSuite;
class TestSuiteState{
public:
int phase;
void parsePlayerState(int playerId, string s);
void parsePlayerState(int playerId, string s,TestSuite * suite);
TestSuiteState();
TestSuitePlayerData playerData[2];
void cleanup();
};
class TestSuite{
public:
MTGAllCards* collection;
int summoningSickness;
float timerLimit;
int currentAction;
@@ -57,10 +60,10 @@ class TestSuite{
int nbfiles;
int currentfile;
void load(const char * filename);
TestSuite(const char * filename);
TestSuite(const char * filename,MTGAllCards* _collection);
void initGame();
int assertGame();
MTGPlayerCards * buildDeck(MTGAllCards * collection, int playerId);
MTGPlayerCards * buildDeck(int playerId);
string getNextAction();
int phaseStrToInt(string s);
MTGCardInstance * getCardByMTGId(int mtgid);
@@ -68,6 +71,7 @@ class TestSuite{
int loadNext();
void cleanup();
int Log(const char * text);
int getMTGId(string name);
};
@@ -75,7 +79,7 @@ class TestSuiteAI:public AIPlayer{
public:
TestSuite * suite;
float timer;
TestSuiteAI(MTGAllCards * collection,TestSuite * suite, int playerId);
TestSuiteAI(TestSuite * suite, int playerId);
virtual int Act(float dt);
virtual int displayStack(){return 1;}
-2
View File
@@ -30,10 +30,8 @@
using std::string;
int lowercase(string source);
int filesize(const char * filename);
int readfile_to_ints(const char * filename, int * out_buffer);
int fileExists(const char * filename);
#ifdef LINUX