* Create selection zones to remember the last card the cursor was on.
This commit is contained in:
jean.chalard
2009-09-12 12:57:50 +00:00
parent 23fb17e58e
commit 34d973c60d
10 changed files with 73 additions and 26 deletions
+5 -3
View File
@@ -3,11 +3,12 @@
#ifndef _CARD_GUI_H_
#define _CARD_GUI_H_
#include <hge/hgeparticle.h>
#include <JGui.h>
#include "Pos.h"
#include "PlayGuiObject.h"
#include "MTGCardInstance.h"
#include <hge/hgeparticle.h>
#include "CardSelector.h"
class MTGCardInstance;
class PlayGuiObject;
@@ -34,10 +35,11 @@ struct CardGui : public PlayGuiObject {
class CardView : public CardGui {
public:
const CardSelector::SelectorZone owner;
MTGCardInstance* getCard(); // remove this when possible
CardView(MTGCardInstance* card, float x, float y);
CardView(MTGCardInstance* card, const Pos& ref);
CardView(const CardSelector::SelectorZone, MTGCardInstance* card, float x, float y);
CardView(const CardSelector::SelectorZone, MTGCardInstance* card, const Pos& ref);
void Render(){CardGui::Render();};
void Render(JQuad* q){Pos::Render(q);};
virtual ostream& toString(ostream&) const;
+6 -2
View File
@@ -22,6 +22,11 @@ struct LimitorFunctor
template <typename T=PlayGuiObject>
class ObjectSelector : public GuiLayer
{
public:
typedef enum {
nullZone, handZone, playZone
} SelectorZone;
protected:
vector<T*> cards;
T* active;
@@ -29,8 +34,7 @@ class ObjectSelector : public GuiLayer
DuelLayers* duel;
LimitorFunctor<T>* limitor;
Pos bigpos;
T* handLast; T* playLast;
map<const SelectorZone, T*> lasts;
public:
ObjectSelector(DuelLayers*);