Files
wagic/projects/mtg/include/DuelLayers.h
Xawotihs@gmail.com f45c8e1d41 Just won my first Wagic network game :)
In details:
- I removed my player swap idea, it caused tons of issues with randoms
- instead I simply keep both peer on the exact same game and added one single parameter allowing to configure the view on the game. So, each peer is rendering the same game (gameObserver class) from a different player point of view (DuelLayers and related classes).
- a lot of gui stuff are missing to prevent user forbidden interactions but it works fine on Windows
2013-01-26 16:42:16 +00:00

65 lines
1.5 KiB
C++

#ifndef _DUELLAYERS_H_
#define _DUELLAYERS_H_
#include "GuiLayers.h"
class MTGGuiHand;
class MTGGuiPlay;
class ActionLayer;
class ActionStack;
class DamageResolverLayer;
class GuiHandSelf;
class GuiHandOpponent;
class GuiCombat;
class GuiAvatars;
class CardSelectorBase;
struct Pos;
class MTGGamePhase;
class DuelLayers
{
protected:
int nbitems;
vector<GuiLayer*> objects;
vector<Pos*> waiters;
GuiCombat* combat;
ActionLayer* action;
ActionStack* stack;
GuiHandSelf *hand;
GuiAvatars * avatars;
GameObserver* observer;
MTGGamePhase* phaseHandler;
int mPlayerViewIndex;
CardSelectorBase* mCardSelector;
public:
DuelLayers(GameObserver* go, int playerViewIndex = 0);
~DuelLayers();
ActionLayer * actionLayer();
ActionStack * stackLayer();
GuiCombat * combatLayer();
GuiAvatars * GetAvatars();
MTGGamePhase* getPhaseHandler() {return phaseHandler;};
virtual void Update(float dt, Player * player);
void CheckUserInput(int isAI);
void Render();
void Add(GuiLayer * layer);
void Remove();
int receiveEvent(WEvent * e);
float RightBoundary();
int getPlayerViewIndex(){ return mPlayerViewIndex; };
Player* getRenderedPlayer();
Player* getRenderedPlayerOpponent();
CardSelectorBase* getCardSelector() { return mCardSelector; };
GameObserver* getObserver(){ return observer; };
};
#include "ActionLayer.h"
#include "GameObserver.h"
#include "MTGGamePhase.h"
#include "ActionStack.h"
#include "Damage.h"
#endif