Files
wagic/projects/mtg/include/GuiHand.h
Xawotihs 9adb9d625d - 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.
2011-10-01 13:30:30 +00:00

88 lines
1.6 KiB
C++

#ifndef _GUIHAND_H_
#define _GUIHAND_H_
#include "GuiLayers.h"
#include "WEvent.h"
#include "MTGGameZones.h"
#include "CardGui.h"
#include "GuiHand.h"
class GuiHand;
struct HandLimitor : public Limitor
{
GuiHand* hand;
virtual bool select(Target*);
virtual bool greyout(Target*);
HandLimitor(GuiHand* hand);
};
class GuiHand : public GuiLayer
{
public:
static const float ClosedRowX;
static const float LeftRowX;
static const float RightRowX;
static const float OpenX;
static const float ClosedX;
static const float OpenY;
static const float ClosedY;
protected:
const MTGHand* hand;
JQuadPtr back;
vector<CardView*> cards;
public:
GuiHand(GameObserver* observer, MTGHand* hand);
~GuiHand();
void Update(float dt);
bool isInHand(CardView*);
friend struct HandLimitor;
};
class GuiHandOpponent : public GuiHand
{
public:
GuiHandOpponent(GameObserver* observer, MTGHand* hand);
virtual void Render();
virtual int receiveEventPlus(WEvent* e);
virtual int receiveEventMinus(WEvent* e);
};
class GuiHandSelf : public GuiHand
{
protected:
typedef enum
{
Open,
Closed
} HandState;
HandState state;
Pos backpos;
public:
GuiHandSelf(GameObserver* observer, MTGHand* hand);
~GuiHandSelf();
virtual int receiveEventPlus(WEvent* e);
virtual int receiveEventMinus(WEvent* e);
void Repos();
bool CheckUserInput(JButton key);
virtual void Render();
void Update(float dt);
float LeftBoundary();
HandState GetState()
{
return state;
}
HandLimitor* limitor;
};
#endif // _GUIHAND_H_