* Added new options parameter. "SaveDetailedDeckInfo". This will force the system to save all
deck files in long format. This is not configurable from the game. It must be set manually
inside options.txt.
ie. saveDetailedDeckInfo=1
* added extra debug information (line number inside text file) when card parser fails to recognize a line.
- modified return value from "processConfLine()" to return 0 only when a true error occurs and print out
"MTGDeck: Bad Line:
[<line no>]: <line with error>"
- processConfLine will now return 1 for lines starting with "#". Previously it returned 0 which is incorrect
as comments should not be considered as errors.
* removed DeckMetaDataList class from code. This was duplicating the DeckMetaData storage in DeckManager
* new feature for deck selection screens.
- player decks will now have an indication of what mana color it consists of.
- Ai decks will show symbols once the player has played against the AI deck at least once.
-- This is made possible with a new meta data inside each deck file.
MANA:<string representing color switches - 0/1 >
This commit is contained in:
@@ -27,10 +27,13 @@ public:
|
||||
vector<DeckMetaData*> * getPlayerDeckOrderList();
|
||||
vector<DeckMetaData*> * getAIDeckOrderList();
|
||||
|
||||
void saveDeck ( MTGDeck *deck, int deckId, MTGAllCards *collection );
|
||||
void AddMetaData( const std::string& filename, bool isAI);
|
||||
DeckMetaData* getDeckMetaDataById(int deckId, bool isAI);
|
||||
DeckMetaData* getDeckMetaDataByFilename(const std::string& filename, bool isAI);
|
||||
StatsWrapper* getExtendedStatsForDeckId(int deckId, MTGAllCards* collection, bool isAI);
|
||||
StatsWrapper* getExtendedDeckStats(DeckMetaData* selectedDeck, MTGAllCards* collection, bool isAI);
|
||||
|
||||
static DeckManager* GetInstance();
|
||||
static void EndInstance();
|
||||
|
||||
|
||||
@@ -22,13 +22,16 @@ private:
|
||||
string mName;
|
||||
int mDeckId;
|
||||
string mAvatarFilename;
|
||||
|
||||
string mColorIndex;
|
||||
|
||||
// statistical information
|
||||
int mGamesPlayed, mVictories, mPercentVictories, mDifficulty;
|
||||
|
||||
DeckMetaData();
|
||||
|
||||
public:
|
||||
|
||||
|
||||
DeckMetaData(const string& filename);
|
||||
void LoadDeck();
|
||||
void LoadStats();
|
||||
@@ -38,6 +41,7 @@ public:
|
||||
string getDescription();
|
||||
string getName();
|
||||
string getAvatarFilename();
|
||||
string getColorIndex();
|
||||
int getAvatarId(int deckId);
|
||||
string getStatsSummary();
|
||||
|
||||
@@ -48,6 +52,7 @@ public:
|
||||
int getDifficulty();
|
||||
string getDifficultyString();
|
||||
|
||||
void setColorIndex(const string& colorIndex);
|
||||
void Invalidate();
|
||||
|
||||
string mStatsFilename;
|
||||
@@ -57,16 +62,5 @@ public:
|
||||
bool mIsAI;
|
||||
};
|
||||
|
||||
class DeckMetaDataList
|
||||
{
|
||||
private:
|
||||
map<string, DeckMetaData *> values;
|
||||
|
||||
public:
|
||||
void invalidate(string filename);
|
||||
DeckMetaData * get(string filename);
|
||||
~DeckMetaDataList();
|
||||
static DeckMetaDataList * decksMetaData;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -59,6 +59,7 @@ public:
|
||||
//My interrupts
|
||||
INTERRUPTMYSPELLS,
|
||||
INTERRUPTMYABILITIES,
|
||||
SAVEDETAILEDDECKINFO,
|
||||
//Other interrupts
|
||||
INTERRUPT_BEFOREBEGIN,
|
||||
INTERRUPT_UNTAP,
|
||||
|
||||
@@ -141,6 +141,7 @@ public:
|
||||
map<int, int> cards;
|
||||
string meta_desc;
|
||||
string meta_name;
|
||||
string meta_deck_colors;
|
||||
int totalCards();
|
||||
int totalPrice();
|
||||
MTGDeck(MTGAllCards * _allcards);
|
||||
@@ -154,6 +155,7 @@ public:
|
||||
int removeAll();
|
||||
int add(MTGCard * card);
|
||||
int remove(MTGCard * card);
|
||||
string getFilename();
|
||||
int save();
|
||||
int save(string destFileName, bool useExpandedDescriptions, string &deckTitle, string &deckDesc);
|
||||
MTGCard * getCardById(int id);
|
||||
|
||||
Reference in New Issue
Block a user