Files
wagic/projects/mtg/include/DeckManager.h
techdragon.nguyen@gmail.com 8af5870d48 * 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 >
2011-01-31 10:04:18 +00:00

48 lines
1.4 KiB
C++

#include <string>
#include <vector>
#include "DeckMetaData.h"
using namespace std;
class DeckManager
{
private:
static bool instanceFlag;
static DeckManager *mInstance;
DeckManager()
{
//private constructor
}
public:
vector<DeckMetaData*> playerDeckOrderList;
vector<DeckMetaData*> aiDeckOrderList;
map<string, StatsWrapper*> playerDeckStatsMap;
map<string, StatsWrapper*> aiDeckStatsMap;
void updateMetaDataList(vector<DeckMetaData*>* refList, bool isAI);
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();
//convenience method to get the difficulty rating between two decks. This should be refined a little more
//since the eventual move of all deck meta data should be managed by this class
static int getDifficultyRating(Player *statsPlayer, Player *player);
~DeckManager();
};