This btw points out another circular dependancy between the texture and the JQuad - a texture owns a bunch of JQuads, yet the renderer uses JQuads and always assumes that the texture is valid. We're going to need to add more defensiveness to JGE to protect against this. Other changes in this check-in: WResourceManager doesn't derive from JResourceManager anymore. It actually didn't require anything from the base, so I killed the dependency. Also cleaned up the notion of a WTrackedQuad in the WCachedResource - it didn't need a separate class, just a better container. I've build this & tested against PSP, win, linux, QT (linux). I haven't tried against iOS and QT Win, or Maemo. If these other platforms are broken, I apologize in advance! - I'm hoping it should be fairly simple to put them back into play.
88 lines
1.6 KiB
C++
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(MTGHand* hand);
|
|
~GuiHand();
|
|
void Update(float dt);
|
|
bool isInHand(CardView*);
|
|
|
|
friend struct HandLimitor;
|
|
};
|
|
|
|
class GuiHandOpponent : public GuiHand
|
|
{
|
|
public:
|
|
GuiHandOpponent(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(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_
|