Page 1 of 1

Code duplication @ AbilityFactory_Animate.java (r9789)

PostPosted: 15 Aug 2011, 15:18
by Max mtg
Compare code of
private static void animateAllResolve(final AbilityFactory af, final SpellAbility sa)
and
private static void animateResolve(final AbilityFactory af, final SpellAbility sa)
in the named class.

It might be a good idea to store the code used by both methods in a single function and call it as needed by each method.

Re: Code duplication @ AbilityFactory_Animate.java (r9789)

PostPosted: 17 Aug 2011, 00:13
by Braids
do you know which cards use these methods? i'm thinking about testing here.

Re: Code duplication @ AbilityFactory_Animate.java (r9789)

PostPosted: 17 Aug 2011, 01:10
by friarsol
Braids wrote:do you know which cards use these methods? i'm thinking about testing here.
Generally how I look for cards is put a "$ " before the terminology.

So "$ Animate" yields me results like Ancient Kavu and Animate Land.
and "$ AnimateAll" yields me results like Mirror Entity and Natural Affinity.

Re: Code duplication @ AbilityFactory_Animate.java (r9789)

PostPosted: 17 Aug 2011, 01:21
by Braids
friarsol wrote:. . .So "$ Animate" yields me results like Ancient Kavu and Animate Land.
and "$ AnimateAll" yields me results like Mirror Entity and Natural Affinity.
thanks be to the good friar!

@Max mtg, if you can implement the change without breaking these cards, i say go for it.