reimplemented mana color display for deck selection. This is now totally controlled by
stats generation. No data needs to be written to the deck master files themselves. Now the mana colors will only show if you have battled with a particular deck at least once. This is not retroactive, so you will need to battle the ai again. This can not be edited manually either to prevent tampering with the statistical data. Player deck mana color display is also covered this way. Decks will still be saved in the new layout if a disk write is necessary. So any changes via the deck editor will result in a deck file rewrite is was always the case.:)
This commit is contained in:
@@ -27,8 +27,6 @@ public:
|
||||
vector<DeckMetaData*> * getPlayerDeckOrderList();
|
||||
vector<DeckMetaData*> * getAIDeckOrderList();
|
||||
|
||||
void saveDeck ( const string& deckFilename, MTGAllCards *collection );
|
||||
void saveDeck ( MTGDeck *deck, MTGAllCards *collection );
|
||||
void AddMetaData( const std::string& filename, bool isAI);
|
||||
DeckMetaData* getDeckMetaDataById(int deckId, bool isAI);
|
||||
DeckMetaData* getDeckMetaDataByFilename(const std::string& filename, bool isAI);
|
||||
|
||||
@@ -15,10 +15,11 @@ class GameObserver;
|
||||
class DeckStat
|
||||
{
|
||||
public:
|
||||
DeckStat(int _nbgames = 0, int _victories = 0);
|
||||
DeckStat(int _nbgames = 0, int _victories = 0, string manaColorIndex = "");
|
||||
|
||||
int nbgames;
|
||||
int victories;
|
||||
string manaColorIndex;
|
||||
int percentVictories();
|
||||
};
|
||||
|
||||
@@ -27,9 +28,8 @@ class DeckStats
|
||||
protected:
|
||||
static DeckStats * mInstance;
|
||||
public:
|
||||
//map<string, DeckStat *> stats; // current set of statistics
|
||||
string currentDeck;
|
||||
map<string, map<string,DeckStat*> > masterDeckStats;
|
||||
map<string, map<string, DeckStat*> > masterDeckStats;
|
||||
|
||||
static DeckStats * GetInstance();
|
||||
static void EndInstance();
|
||||
@@ -94,7 +94,8 @@ public:
|
||||
int countNonLandProducersPerColor[Constants::MTG_NB_COLORS + 1];
|
||||
int totalCostPerColor[Constants::MTG_NB_COLORS + 1];
|
||||
int totalColoredSymbols;
|
||||
|
||||
|
||||
string getManaColorIndex();
|
||||
void updateStats(string filename, MTGAllCards * collection);
|
||||
void updateStats(DeckDataWrapper *mtgDeck);
|
||||
int countCardsByType(const char * _type, DeckDataWrapper * myDeck);
|
||||
|
||||
@@ -157,7 +157,6 @@ public:
|
||||
string meta_desc;
|
||||
string meta_name;
|
||||
int meta_id;
|
||||
string meta_deck_colors;
|
||||
int totalCards();
|
||||
int totalPrice();
|
||||
MTGDeck(MTGAllCards * _allcards);
|
||||
|
||||
Reference in New Issue
Block a user