Files
wagic/projects/mtg/include/GuiCombat.h
Xawotihs 9adb9d625d - reworked the testsuite and the rules (storyflow) to use the same game deserialization code, moved that code to the players and zone classes
- removed every references to the gameobserver singleton. This object can now be instantiated several times as it's needed for minmax. To be able to do that, I mostly added a reference to a gameobserver from any targetable object (cards, players, spells) and abilities.
2011-10-01 13:30:30 +00:00

51 lines
1.1 KiB
C++

#ifndef _GUICOMBAT_H_
#define _GUICOMBAT_H_
#include <vector>
#include "WEvent.h"
#include "CardGui.h"
#include "MTGCardInstance.h"
#include "DamagerDamaged.h"
class GuiCombat: public GuiLayer
{
protected:
DamagerDamaged* active;
AttackerDamaged* activeAtk;
static JTexture* ok_tex;
Pos ok, enemy_avatar;
DamagerDamaged* current;
enum
{
BLK,
ATK,
OK,
NONE
} cursor_pos;
CombatStep step;
void validateDamage();
void addOne(DefenserDamaged* blocker, CombatStep);
void removeOne(DefenserDamaged* blocker, CombatStep);
void remaskBlkViews(AttackerDamaged* before, AttackerDamaged* after);
int resolve();
public:
vector<AttackerDamaged*> attackers;
void autoaffectDamage(AttackerDamaged* attacker, CombatStep);
GuiCombat(GameObserver* go);
~GuiCombat();
virtual void Update(float dt);
virtual void Render();
bool clickOK();
virtual bool CheckUserInput(JButton key);
virtual int receiveEventPlus(WEvent* e);
virtual int receiveEventMinus(WEvent* e);
typedef vector<AttackerDamaged*>::iterator inner_iterator;
};
#endif // _GUICOMBAT_H_