No code change just reformatting of header files.

finishing up my reformatting of the source from November/December following the guidelines that were posted.
some extra things I added:
   * Any empty virtual declarations were kept to one line.  
   * Enums were split up into separate lines to promote uniformity across all headers. ( each header file had a different style for enums)
This commit is contained in:
techdragon.nguyen@gmail.com
2011-01-21 18:01:14 +00:00
parent 6d3d4c1792
commit e53c16f700
101 changed files with 6128 additions and 4684 deletions
+130 -102
View File
@@ -26,189 +26,217 @@ public:
TARGET_FROM,
};
int type; //Deprecated, use dynamic casting instead
WEvent(int type = NOT_SPECIFIED);
virtual ~WEvent() {};
virtual std::ostream& toString(std::ostream& out) const;
virtual int getValue() {return 0;};
virtual Targetable * getTarget(int target) {return 0;};
WEvent(int type = NOT_SPECIFIED);
virtual ~WEvent() {};
virtual std::ostream& toString(std::ostream& out) const;
virtual int getValue()
{
return 0;
}
;
virtual Targetable * getTarget(int target)
{
return 0;
}
;
};
struct WEventZoneChange : public WEvent {
MTGCardInstance * card;
MTGGameZone * from;
MTGGameZone * to;
WEventZoneChange(MTGCardInstance * card, MTGGameZone * from, MTGGameZone *to);
virtual ~WEventZoneChange() {};
virtual std::ostream& toString(std::ostream& out) const;
virtual Targetable * getTarget(int target);
struct WEventZoneChange: public WEvent
{
MTGCardInstance * card;
MTGGameZone * from;
MTGGameZone * to;
WEventZoneChange(MTGCardInstance * card, MTGGameZone * from, MTGGameZone *to);
virtual ~WEventZoneChange() {};
virtual std::ostream& toString(std::ostream& out) const;
virtual Targetable * getTarget(int target);
};
struct WEventDamage : public WEvent {
Damage * damage;
WEventDamage(Damage * damage);
virtual std::ostream& toString(std::ostream& out) const;
virtual int getValue();
virtual Targetable * getTarget(int target);
struct WEventDamage: public WEvent
{
Damage * damage;
WEventDamage(Damage * damage);
virtual std::ostream& toString(std::ostream& out) const;
virtual int getValue();
virtual Targetable * getTarget(int target);
};
struct WEventDamageStackResolved : public WEvent {
WEventDamageStackResolved();
struct WEventDamageStackResolved: public WEvent
{
WEventDamageStackResolved();
};
struct WEventPhaseChange : public WEvent {
Phase * from;
Phase * to;
WEventPhaseChange(Phase * from, Phase * to);
struct WEventPhaseChange: public WEvent
{
Phase * from;
Phase * to;
WEventPhaseChange(Phase * from, Phase * to);
};
//Abstract class of event when a card's status changes
struct WEventCardUpdate : public WEvent {
MTGCardInstance * card;
WEventCardUpdate(MTGCardInstance * card);
struct WEventCardUpdate: public WEvent
{
MTGCardInstance * card;
WEventCardUpdate(MTGCardInstance * card);
};
//Event when a card gains/looses types
struct WEventCardChangeType : public WEventCardUpdate {
int type;
bool before;
bool after;
WEventCardChangeType(MTGCardInstance * card, int type, bool before, bool after);
struct WEventCardChangeType: public WEventCardUpdate
{
int type;
bool before;
bool after;
WEventCardChangeType(MTGCardInstance * card, int type, bool before, bool after);
};
//Event when a card is tapped/untapped
struct WEventCardTap : public WEventCardUpdate {
bool before;
bool after;
WEventCardTap(MTGCardInstance * card, bool before, bool after);
virtual Targetable * getTarget(int target);
struct WEventCardTap: public WEventCardUpdate
{
bool before;
bool after;
WEventCardTap(MTGCardInstance * card, bool before, bool after);
virtual Targetable * getTarget(int target);
};
struct WEventCardTappedForMana : public WEventCardUpdate {
bool before;
bool after;
WEventCardTappedForMana(MTGCardInstance * card, bool before, bool after);
virtual Targetable * getTarget(int target);
struct WEventCardTappedForMana: public WEventCardUpdate
{
bool before;
bool after;
WEventCardTappedForMana(MTGCardInstance * card, bool before, bool after);
virtual Targetable * getTarget(int target);
};
//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 {
Targetable * before;
Targetable * after;
WEventCreatureAttacker(MTGCardInstance * card, Targetable * from, Targetable * to);
struct WEventCreatureAttacker: public WEventCardUpdate
{
Targetable * before;
Targetable * after;
WEventCreatureAttacker(MTGCardInstance * card, Targetable * from, Targetable * to);
};
//event when card attacks.
struct WEventCardAttacked : public WEventCardUpdate {
WEventCardAttacked(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
struct WEventCardAttacked: public WEventCardUpdate
{
WEventCardAttacked(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
//event when card attacks alone.
struct WEventCardAttackedAlone : public WEventCardUpdate {
WEventCardAttackedAlone(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
struct WEventCardAttackedAlone: public WEventCardUpdate
{
WEventCardAttackedAlone(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
//event when card attacks but is not blocked.
struct WEventCardAttackedNotBlocked : public WEventCardUpdate {
WEventCardAttackedNotBlocked(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
struct WEventCardAttackedNotBlocked: public WEventCardUpdate
{
WEventCardAttackedNotBlocked(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
//event when card attacks but is blocked.
struct WEventCardAttackedBlocked : public WEventCardUpdate {
WEventCardAttackedBlocked(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
struct WEventCardAttackedBlocked: public WEventCardUpdate
{
WEventCardAttackedBlocked(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
//event when card blocked.
struct WEventCardBlocked : public WEventCardUpdate {
WEventCardBlocked(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
struct WEventCardBlocked: public WEventCardUpdate
{
WEventCardBlocked(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
//event when card is sacrificed.
struct WEventCardSacrifice : public WEventCardUpdate {
WEventCardSacrifice(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
struct WEventCardSacrifice: public WEventCardUpdate
{
WEventCardSacrifice(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
//event when card is discarded.
struct WEventCardDiscard : public WEventCardUpdate {
WEventCardDiscard(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
struct WEventCardDiscard: public WEventCardUpdate
{
WEventCardDiscard(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
//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 {
MTGCardInstance * before;
MTGCardInstance * after;
WEventCreatureBlocker(MTGCardInstance * card,MTGCardInstance * from,MTGCardInstance * to);
struct WEventCreatureBlocker: public WEventCardUpdate
{
MTGCardInstance * before;
MTGCardInstance * after;
WEventCreatureBlocker(MTGCardInstance * card, MTGCardInstance * from, MTGCardInstance * to);
};
//Event sent when attackers have been chosen and they
//cannot be changed any more.
struct WEventAttackersChosen : public WEvent {
struct WEventAttackersChosen: public WEvent
{
};
//Event sent when blockers have been chosen and they
//cannot be changed any more.
struct WEventBlockersChosen : public WEvent {
struct WEventBlockersChosen: public WEvent
{
};
struct WEventcardDraw : public WEvent {
WEventcardDraw(Player * player,int nb_cards);
Player * player;
int nb_cards;
virtual Targetable * getTarget(Player * player);
struct WEventcardDraw: public WEvent
{
WEventcardDraw(Player * player, int nb_cards);
Player * player;
int nb_cards;
virtual Targetable * getTarget(Player * player);
};
//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 {
MTGCardInstance * exchangeWith;
MTGCardInstance * attacker;
WEventCreatureBlockerRank(MTGCardInstance * card,MTGCardInstance * exchangeWith, MTGCardInstance * attacker);
struct WEventCreatureBlockerRank: public WEventCardUpdate
{
MTGCardInstance * exchangeWith;
MTGCardInstance * attacker;
WEventCreatureBlockerRank(MTGCardInstance * card, MTGCardInstance * exchangeWith, MTGCardInstance * attacker);
};
//Event when a combat phase step ends
struct WEventCombatStepChange : public WEvent
struct WEventCombatStepChange: public WEvent
{
CombatStep step;
WEventCombatStepChange(CombatStep);
CombatStep step;
WEventCombatStepChange(CombatStep);
};
//Event when a mana is engaged
//color : color
struct WEventEngageMana : public WEvent {
int color;
MTGCardInstance* card;
ManaPool * destination;
WEventEngageMana(int color, MTGCardInstance* card, ManaPool * destination);
struct WEventEngageMana: public WEvent
{
int color;
MTGCardInstance* card;
ManaPool * destination;
WEventEngageMana(int color, MTGCardInstance* card, ManaPool * destination);
};
//Event when a mana is consumed
//color : color
struct WEventConsumeMana : public WEvent {
int color;
ManaPool * source;
WEventConsumeMana(int color, ManaPool * source);
struct WEventConsumeMana: public WEvent
{
int color;
ManaPool * source;
WEventConsumeMana(int color, ManaPool * source);
};
//Event when a manapool is emptied
//color : color
struct WEventEmptyManaPool : public WEvent {
ManaPool * source;
WEventEmptyManaPool(ManaPool * source);
struct WEventEmptyManaPool: public WEvent
{
ManaPool * source;
WEventEmptyManaPool(ManaPool * source);
};
std::ostream& operator<<(std::ostream&, const WEvent&);