- Modified DuelLayers to not use a global MTGPhaseGame instance anymore - Moved the reset of currentActionCard out of the ActionLayer render function : that fixes the remaing problematic tests in the multithreaded testsuite - Added a method in ActionLayer converting a card ability into a menu index - Used this new method in the game observer to log correctly AI ability actions - Added a DumpAssert method in the game observer, it can be used to dump the game and assert in order to easy crash reproduction - Cleaned up TargetList properties access - Added an optimisation in GuiMana to not compute update code if the rendering is not used (multi-threaded mode) - Added a deadlock detection in the test AI vs AI multithreaded mode - Fixed minor bugs in test AI vs AI multithreaded mode - Added a games/second counter in the test AI vs AI rendering
46 lines
1.4 KiB
C++
46 lines
1.4 KiB
C++
#include <string>
|
|
#include <vector>
|
|
|
|
#include "DeckMetaData.h"
|
|
|
|
using namespace std;
|
|
|
|
class DeckManager
|
|
{
|
|
private:
|
|
vector<DeckMetaData*> playerDeckOrderList;
|
|
vector<DeckMetaData*> aiDeckOrderList;
|
|
map<string, StatsWrapper*> playerDeckStatsMap;
|
|
map<string, StatsWrapper*> aiDeckStatsMap;
|
|
|
|
static DeckManager *mInstance;
|
|
|
|
public:
|
|
DeckManager()
|
|
{
|
|
//private constructor
|
|
}
|
|
|
|
void updateMetaDataList(vector<DeckMetaData*>* refList, bool isAI);
|
|
vector<DeckMetaData*> * getPlayerDeckOrderList();
|
|
vector<DeckMetaData*> * getAIDeckOrderList();
|
|
|
|
void AddMetaData( const std::string& filename, bool isAI);
|
|
void DeleteMetaData( 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
|
|
|
|
int getDifficultyRating(Player *statsPlayer, Player *player);
|
|
|
|
~DeckManager();
|
|
|
|
};
|