public float CalculateReduction(SourcedDamage damage) { var value = damage.Value.Value; switch (damage.Value.Type) { case DamageType.Physical: return(Physical.CalculateReduction(value)); case DamageType.Magical: return(Magical.CalculateReduction(value)); case DamageType.Pure: return(0f); default: throw new ArgumentOutOfRangeException(); } }
public Damage CalculateDamageAfterReductions(Damage damage) { var value = damage.Value; switch (damage.Type) { case DamageType.Physical: value = Physical.CalculateReduction(value); break; case DamageType.Magical: value = Magical.CalculateReduction(value); break; case DamageType.Pure: case DamageType.Modification: break; default: break; } return(new Damage(value, damage.Type, damage.Source)); }