Files
wagic/projects/mtg/include/GuiLayers.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

64 lines
1.1 KiB
C++

#ifndef _GUI_LAYERS_H_
#define _GUI_LAYERS_H_
#define DIR_DOWN 1
#define DIR_UP 2
#define DIR_LEFT 3
#define DIR_RIGHT 4
#include <JGui.h>
#include "WEvent.h"
class GameObserver;
class Player;
class DuelLayers;
class GuiLayer
{
protected:
JButton mActionButton;
GameObserver* observer;
DuelLayers* mpDuelLayers;
public:
int mCurr;
vector<JGuiObject *> mObjects;
vector<JGuiObject *> manaObjects;
void Add(JGuiObject * object);
int Remove(JGuiObject * object);
int modal;
bool hasFocus;
virtual void resetObjects();
int getMaxId();
GuiLayer(GameObserver *observer);
GuiLayer(DuelLayers *duelLayers);
virtual ~GuiLayer();
virtual void Update(float dt);
virtual bool CheckUserInput(JButton key)
{
return false;
}
int getIndexOf(JGuiObject * object);
JGuiObject * getByIndex(int index);
virtual void Render();
int empty()
{
if (mObjects.size())
return 0;
return 1;
}
virtual int receiveEventPlus(WEvent * e)
{
return 0;
}
virtual int receiveEventMinus(WEvent * e)
{
return 0;
}
};
#endif