* Some interface updates.
This commit is contained in:
jean.chalard
2009-09-13 10:57:55 +00:00
parent 7c4fbde7d3
commit 1f67998d7a
5 changed files with 90 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
#define _CARDSELECTOR_H_
#include <vector>
#include <stack>
#include "GuiLayers.h"
#include "DuelLayers.h"
#include "Pos.h"
@@ -26,6 +27,13 @@ class ObjectSelector : public GuiLayer
typedef enum {
nullZone, handZone, playZone
} SelectorZone;
struct SelectorMemory
{
T* object;
float x, y;
SelectorMemory(T* object) : object(object) { if (object) { x = object->x; y = object->y; } };
SelectorMemory() { object = NULL; x = y = 0; };
};
protected:
vector<T*> cards;
@@ -34,7 +42,10 @@ class ObjectSelector : public GuiLayer
DuelLayers* duel;
LimitorFunctor<T>* limitor;
Pos bigpos;
map<const SelectorZone, T*> lasts;
map<const SelectorZone, SelectorMemory> lasts;
stack<SelectorMemory> memoryStack;
T* fetchMemory(SelectorMemory&);
public:
ObjectSelector(DuelLayers*);
@@ -44,6 +55,8 @@ class ObjectSelector : public GuiLayer
void Update(float dt);
void Render();
void Limit(LimitorFunctor<T>* limitor);
void Push();
void Pop();
typedef T Target;
};