J :
* Order blocker interface.
This commit is contained in:
@@ -25,9 +25,9 @@ struct CardGui : public PlayGuiObject {
|
||||
MTGCardInstance* card;
|
||||
CardGui(MTGCardInstance* card, float x, float y);
|
||||
CardGui(MTGCardInstance* card, const Pos& ref);
|
||||
virtual void Render() = 0;
|
||||
virtual void Render();
|
||||
void RenderBig(const Pos&);
|
||||
virtual void Update(float dt) = 0;
|
||||
virtual void Update(float dt);
|
||||
static void alternateRender(MTGCard * card, const Pos& pos);
|
||||
virtual ostream& toString(ostream&) const;
|
||||
};
|
||||
@@ -38,41 +38,15 @@ class CardView : public CardGui {
|
||||
MTGCardInstance* getCard(); // remove this when possible
|
||||
CardView(MTGCardInstance* card, float x, float y);
|
||||
CardView(MTGCardInstance* card, const Pos& ref);
|
||||
virtual void Render();
|
||||
void Render(){CardGui::Render();};
|
||||
void Render(JQuad* q){Pos::Render(q);};
|
||||
void RenderSelected();
|
||||
virtual void Update(float dt);
|
||||
virtual ostream& toString(ostream&) const;
|
||||
};
|
||||
|
||||
class TransientCardView : public CardView {
|
||||
class TransientCardView : public CardGui {
|
||||
public:
|
||||
TransientCardView(MTGCardInstance* card, float x, float y);
|
||||
TransientCardView(MTGCardInstance* card, const Pos& ref);
|
||||
virtual void Render();
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
class CardGui: public PlayGuiObject{
|
||||
protected:
|
||||
hgeParticleSystem * mParticleSys;
|
||||
int alpha;
|
||||
float actX, actY;
|
||||
public:
|
||||
MTGCardInstance * card;
|
||||
CardGui(int id, MTGCardInstance * _card, float desiredHeight, float _x=0, float _y=0, bool hasFocus = false);
|
||||
virtual void Render();
|
||||
virtual void Update(float dt);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
|
||||
float Height();
|
||||
float Width();
|
||||
|
||||
void RenderBig(float x=-1, float y = -1, int alternate = 0);
|
||||
|
||||
~CardGui();
|
||||
};
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,4 +45,9 @@ class ObjectSelector : public GuiLayer
|
||||
typedef ObjectSelector<> CardSelector;
|
||||
typedef LimitorFunctor<CardSelector::Target> Limitor;
|
||||
|
||||
struct Exp
|
||||
{
|
||||
static inline bool test(CardSelector::Target*, CardSelector::Target*);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,11 +9,21 @@
|
||||
class GuiCombat : public GuiLayer
|
||||
{
|
||||
protected:
|
||||
CardSelector* cs;
|
||||
GameObserver* go;
|
||||
TransientCardView* active, *activeAtk;
|
||||
JQuad* ok_quad;
|
||||
Pos ok;
|
||||
vector<MTGCardInstance*> attackers;
|
||||
TransientCardView* current;
|
||||
enum { BLK, ATK, OK, NONE } cursor_pos;
|
||||
|
||||
vector<TransientCardView*> atkViews;
|
||||
vector<TransientCardView*> blkViews;
|
||||
|
||||
void generateBlkViews(MTGCardInstance* card);
|
||||
|
||||
public:
|
||||
GuiCombat(CardSelector* cs);
|
||||
GuiCombat(GameObserver* go);
|
||||
~GuiCombat();
|
||||
virtual void Update(float dt);
|
||||
virtual void Render();
|
||||
|
||||
@@ -69,7 +69,8 @@ class MTGCardInstance: public MTGCard, public Damageable {
|
||||
list<MTGCardInstance *>blockers;
|
||||
int attacker;
|
||||
int toggleDefenser(MTGCardInstance * opponent);
|
||||
int moveBlockerInRow(MTGCardInstance * blocker);
|
||||
int raiseBlockerRankOrder(MTGCardInstance * blocker);
|
||||
int bringBlockerToFrontOfOrder(MTGCardInstance * blocker);
|
||||
int toggleAttacker();
|
||||
MTGCardInstance * banding; // If belongs to a band when attacking
|
||||
int canBlock();
|
||||
|
||||
@@ -8,9 +8,9 @@ class Phase;
|
||||
class Targetable;
|
||||
class ManaPool;
|
||||
|
||||
class WEvent{
|
||||
class WEvent {
|
||||
public:
|
||||
enum{
|
||||
enum {
|
||||
NOT_SPECIFIED = 0,
|
||||
CHANGE_ZONE = 1,
|
||||
DAMAGE = 2,
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
virtual ~WEvent() {};
|
||||
};
|
||||
|
||||
struct WEventZoneChange: public WEvent{
|
||||
struct WEventZoneChange : public WEvent {
|
||||
MTGCardInstance * card;
|
||||
MTGGameZone * from;
|
||||
MTGGameZone * to;
|
||||
@@ -30,12 +30,12 @@ struct WEventZoneChange: public WEvent{
|
||||
};
|
||||
|
||||
|
||||
struct WEventDamage: public WEvent{
|
||||
struct WEventDamage : public WEvent {
|
||||
Damage * damage;
|
||||
WEventDamage(Damage * damage);
|
||||
};
|
||||
|
||||
struct WEventPhaseChange: public WEvent{
|
||||
struct WEventPhaseChange : public WEvent {
|
||||
Phase * from;
|
||||
Phase * to;
|
||||
WEventPhaseChange(Phase * from, Phase * to);
|
||||
@@ -43,13 +43,13 @@ struct WEventPhaseChange: public WEvent{
|
||||
|
||||
|
||||
//Abstract class of event when a card's status changes
|
||||
struct WEventCardUpdate: public WEvent{
|
||||
struct WEventCardUpdate : public WEvent {
|
||||
MTGCardInstance * card;
|
||||
WEventCardUpdate(MTGCardInstance * card);
|
||||
};
|
||||
|
||||
//Event when a card is tapped/untapped
|
||||
struct WEventCardTap: public WEventCardUpdate{
|
||||
struct WEventCardTap : public WEventCardUpdate {
|
||||
bool before;
|
||||
bool after;
|
||||
WEventCardTap(MTGCardInstance * card, bool before, bool after);
|
||||
@@ -58,7 +58,7 @@ struct WEventCardTap: public WEventCardUpdate{
|
||||
//Event when a card's "attacker" status changes
|
||||
//before:Player/Planeswalker that card was attacking previously
|
||||
//after: Player/Planeswalker that card is attacking now
|
||||
struct WEventCreatureAttacker: public WEventCardUpdate{
|
||||
struct WEventCreatureAttacker : public WEventCardUpdate {
|
||||
Targetable * before;
|
||||
Targetable * after;
|
||||
WEventCreatureAttacker(MTGCardInstance * card, Targetable * from, Targetable * to);
|
||||
@@ -67,7 +67,7 @@ struct WEventCreatureAttacker: public WEventCardUpdate{
|
||||
//Event when a card's "defenser" status changes
|
||||
//before : attacker that card was blocking previously
|
||||
//after: attacker that card is blocking now
|
||||
struct WEventCreatureBlocker: public WEventCardUpdate{
|
||||
struct WEventCreatureBlocker : public WEventCardUpdate {
|
||||
MTGCardInstance * before;
|
||||
MTGCardInstance * after;
|
||||
WEventCreatureBlocker(MTGCardInstance * card,MTGCardInstance * from,MTGCardInstance * to);
|
||||
@@ -76,11 +76,14 @@ struct WEventCreatureBlocker: public WEventCardUpdate{
|
||||
//Event when a blocker is reordered
|
||||
//exchangeWith: exchange card's position with exchangeWith's position
|
||||
//attacker:both card and exchangeWith *should* be in attacker's "blockers" list.
|
||||
struct WEventCreatureBlockerRank: public WEventCardUpdate{
|
||||
struct WEventCreatureBlockerRank : public WEventCardUpdate {
|
||||
MTGCardInstance * exchangeWith;
|
||||
MTGCardInstance * attacker;
|
||||
WEventCreatureBlockerRank(MTGCardInstance * card,MTGCardInstance * exchangeWith, MTGCardInstance * attacker);
|
||||
};
|
||||
|
||||
//Event when blockers are assigned and need to be reordered
|
||||
struct WEventBlockersAssigned : public WEvent {
|
||||
};
|
||||
|
||||
//Event when a mana is engaged
|
||||
|
||||
Reference in New Issue
Block a user