Files
wagic/projects/mtg/include/GuiCombat.h
techdragon.nguyen@gmail.com c88ed95c95 enabled touch code for handling choosign blockers on touch interface.
TODO:  Please have somebody test on non-Touch device.  I don't have one anymore.  If it breaks it let me know and I'll make it a compile time option.  Seems to work with 2 and 3 blockers.  I couldn't get the game to get 4 blockers on the screen, but I think it should work the same.  This should be cross platform and not iOS specific
2011-12-30 23:42:13 +00:00

52 lines
1.2 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);
void shiftLeft( DamagerDamaged* oldActive );
void shiftRight( DamagerDamaged* oldActive );
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_