Files
wagic/projects/mtg/include/ActionLayer.h
wagic.the.homebrew@gmail.com 0bf83b6bf5 Erwan
- fixed a bug with Flagstones of Trokair. There was no easy fix (cloned objects deleting stuff from their parents...) and I ended up using a "garbage collect at end of turn" technique the way I did with the ActionStack. As a result, the memory print of a turn will become bigger, and even more bugs might occur at the end of a turn... I'm ready to discuss this, although I think it's the best solution (in terms of result/amount of work) given the way abilities work right now
- Test suite now gives the number of failed/success at the end of the tests
2009-09-26 14:25:29 +00:00

53 lines
1.5 KiB
C++

/*
* Wagic, The Homebrew ?! is licensed under the BSD license
* See LICENSE in the Folder's root
* http://wololo.net/wagic/
*/
#ifndef _ACTIONLAYER_H_
#define _ACTIONLAYER_H_
#include "GuiLayers.h"
#include "ActionElement.h"
#include "SimpleMenu.h"
#include "MTGAbility.h"
class GuiLayer;
class Targetable;
class WEvent;
class ActionLayer: public GuiLayer, public JGuiListener{
public:
vector <ActionElement *> garbage;
Targetable * menuObject;
SimpleMenu * abilitiesMenu;
int stuffHappened;
virtual void Render();
virtual void Update(float dt);
int unstoppableRenderInProgress();
bool CheckUserInput(u32 key);
ActionLayer(){ menuObject = NULL; abilitiesMenu = NULL; stuffHappened = 0;};
~ActionLayer();
int cancelCurrentAction();
ActionElement * isWaitingForAnswer();
int isReactingToTargetClick(Targetable * card);
int receiveEventPlus(WEvent * event);
int reactToTargetClick(Targetable * card);
int isReactingToClick(MTGCardInstance * card);
int reactToClick(MTGCardInstance * card);
int reactToClick(ActionElement * ability,MTGCardInstance * card);
int reactToTargetClick(ActionElement * ability,Targetable * card);
int stillInUse(MTGCardInstance * card);
void setMenuObject(Targetable * object);
void ButtonPressed(int controllerid, int controlid);
void doReactTo(int menuIndex);
TargetChooser * getCurrentTargetChooser();
MTGAbility * getAbility(int type);
int moveToGarbage(ActionElement * e);
int cleanGarbage();
};
#endif