- reworked the testsuite and the rules (storyflow) to use the same game deserialization code, moved that code to the players and zone classes

- removed every references to the gameobserver singleton. This object can now be instantiated several times as it's needed for minmax. To be able to do that, I mostly added a reference to a gameobserver from any targetable object (cards, players, spells) and abilities.
This commit is contained in:
Xawotihs
2011-10-01 13:30:30 +00:00
parent d6db0c4f63
commit 9adb9d625d
86 changed files with 1902 additions and 1961 deletions

View File

@@ -24,13 +24,13 @@ using namespace std;
class GameObserver{
protected:
static GameObserver * mInstance;
MTGCardInstance * cardWaitingForTargets;
queue<WEvent *> eventsQueue;
int nbPlayers;
int untap(MTGCardInstance * card);
bool WaitForExtraPayment(MTGCardInstance* card);
void initialize();
public:
int currentPlayerId;
@@ -56,19 +56,20 @@ class GameObserver{
int cardClick(MTGCardInstance * card,Targetable * _object = NULL );
int getCurrentGamePhase();
const char * getCurrentGamePhaseName();
const char * getNextGamePhaseName();
void nextCombatStep();
void userRequestNextGamePhase();
void nextGamePhase();
void cleanupPhase();
void nextPlayer();
static void Init(Player * _players[], int _nbplayers);
static GameObserver * GetInstance();
static void EndInstance();
void setPlayers(Player * _players[], int _nbplayers);
Player * currentPlayer;
Player * currentActionPlayer;
Player * isInterrupting;
Player * opponent();
Player * currentlyActing();
GameObserver();
GameObserver(Player * _players[], int _nbplayers);
~GameObserver();
void gameStateBasedEffects();
@@ -86,6 +87,7 @@ class GameObserver{
void Update(float dt);
void Render();
void ButtonPressed(PlayGuiObject*);
int getPlayersNumber() {return nbPlayers;};
int receiveEvent(WEvent * event);
bool connectRule;