- Card Primitives system. Check Royal Assassin in RV, 10E, M10
- Please review, is sets/primitives a good directory? Should we rename MTGCard into "CardPrint"? 
- Unfortunately for now it is not possible to "override" a Primitive. A card that links to a primitive but also defines new "values" will create its own data and ignore the data in the "linked" primitive for the time being. I hope to solve that at some point...
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-12-27 12:14:36 +00:00
parent 6135774016
commit 05a72de5bc
29 changed files with 713 additions and 564 deletions
+8 -6
View File
@@ -15,6 +15,7 @@ using std::string;
class GameApp;
class MTGCard;
class CardPrimitive;
#define SET_METADATA "setinfo.txt"
@@ -80,10 +81,8 @@ extern MTGSets setlist;
class MTGAllCards {
private:
MTGCard * tempCard;
#if defined (_DEBUG)
bool committed;
#endif
MTGCard * tempCard; //used by parser
CardPrimitive * tempPrimitive; //used by parser
protected:
int conf_read_mode;
int colorsCount[Constants::MTG_NB_COLORS];
@@ -95,6 +94,7 @@ private:
vector<int> ids;
map<int, MTGCard *> collection;
map<string,CardPrimitive *>primitives;
MTGAllCards();
~MTGAllCards();
MTGCard * _(int id);
@@ -102,7 +102,7 @@ private:
MTGAllCards(const char * config_file, const char * set_name);
MTGCard * getCardById(int id);
MTGCard * getCardByName(string name);
int load(const char * config_file, const char * setName, int autoload = 1);
int load(const char * config_file, const char * setName = NULL, int autoload = 1);
int countByType(const char * _type);
int countByColor(int color);
int countBySet(int setId);
@@ -110,7 +110,9 @@ private:
int totalCards();
int randomCardId();
private:
int processConfLine(string s, MTGCard* card);
int processConfLine(string s, MTGCard* card, CardPrimitive * primitive);
bool addCardToCollection(MTGCard * card, int setId);
bool addPrimitive(CardPrimitive * primitive, MTGCard * card = NULL);
};