Erwan
- It is now possible to have avatars associated to each Deck - Added SFX - Added Music files - Possibility to choose your opponent - Opponents' difficulty is measured according to their number of victories against a given deck
This commit is contained in:
36
projects/mtg/include/DeckStats.h
Normal file
36
projects/mtg/include/DeckStats.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef _DECKSTATS_H_
|
||||
#define _DECKSTATS_H_
|
||||
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class Player;
|
||||
class GameObserver;
|
||||
|
||||
class DeckStat{
|
||||
public:
|
||||
int nbgames;
|
||||
int victories;
|
||||
DeckStat(int _nbgames = 0 , int _victories = 0):nbgames(_nbgames),victories(_victories){};
|
||||
int percentVictories();
|
||||
};
|
||||
|
||||
class DeckStats{
|
||||
protected:
|
||||
static DeckStats * mInstance;
|
||||
public:
|
||||
map<string, DeckStat *>stats;
|
||||
static DeckStats * GetInstance();
|
||||
void saveStats(Player * player, Player * opponent, GameObserver * game);
|
||||
void save(const char * filename);
|
||||
void save(Player * player);
|
||||
void load(const char * filename);
|
||||
void load(Player * player);
|
||||
void cleanStats();
|
||||
~DeckStats();
|
||||
int percentVictories(string opponentsDeckFile);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user