Re: Hanmac's Refactoring Thread
Posted: 30 Dec 2016, 15:13
I commited the Second Part of my changes with Damage.
as you can see, CardDamageMap is used everywhere through the whole damage functions.
i also added a few test cases for:
they all pass for now.
now i try the Fixed Amount Replacement, for that i might need a new Effect (and maybe a new Effect for the whole thing instead of a EffectEffect)
PS: hm maybe i do need to refactor getPreventNextDamage and getPreventNextDamageWithEffect but for that i am unsure yet.
as you can see, CardDamageMap is used everywhere through the whole damage functions.
i also added a few test cases for:
- Damage + Lifelink
- Damage + Lifelink Multiplication (Gisela, Blade of Goldnight)
- Damage + Lifelink Redirection (Palisade Giant)
- Damage + Lifelink Multiple Damages Sources (Cone of Flame)
they all pass for now.
now i try the Fixed Amount Replacement, for that i might need a new Effect (and maybe a new Effect for the whole thing instead of a EffectEffect)
PS: hm maybe i do need to refactor getPreventNextDamage and getPreventNextDamageWithEffect but for that i am unsure yet.