Replace defines in Damage.h with enums.

This commit is contained in:
Tobias Loose
2013-11-17 17:12:58 +01:00
parent 146872797b
commit 3ca2f1c1ed
12 changed files with 53 additions and 46 deletions

View File

@@ -6,7 +6,7 @@
#include "AllAbilities.h"
REDamagePrevention::REDamagePrevention(MTGAbility * source, TargetChooser *tcSource, TargetChooser *tcTarget, int damage,
bool oneShot, int typeOfDamage) :
bool oneShot, Damage::DamageType typeOfDamage) :
source(source), tcSource(tcSource), tcTarget(tcTarget), damage(damage), oneShot(oneShot), typeOfDamage(typeOfDamage)
{
}
@@ -18,7 +18,7 @@ WEvent * REDamagePrevention::replace(WEvent *event)
WEventDamage * e = dynamic_cast<WEventDamage*> (event);
if (!e) return event;
Damage *d = e->damage;
if (d->typeOfDamage != typeOfDamage && typeOfDamage != DAMAGE_ALL_TYPES) return event;
if (d->typeOfDamage != typeOfDamage && typeOfDamage != Damage::DAMAGE_ALL_TYPES) return event;
if ((!tcSource || tcSource->canTarget(d->source)) && (!tcTarget || tcTarget->canTarget(d->target)))
{
if (damage == -1)