It is currently 13 Sep 2025, 10:06
   
Text Size

Code duplication @ AbilityFactory_Animate.java (r9789)

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Code duplication @ AbilityFactory_Animate.java (r9789)

Postby Max mtg » 15 Aug 2011, 15:18

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.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Code duplication @ AbilityFactory_Animate.java (r9789)

Postby Braids » 17 Aug 2011, 00:13

do you know which cards use these methods? i'm thinking about testing here.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. ;)
User avatar
Braids
Programmer
 
Posts: 556
Joined: 22 Jun 2011, 00:39
Location: Unknown. Hobby: Driving myself and others to constructive madness.
Has thanked: 1 time
Been thanked: 1 time

Re: Code duplication @ AbilityFactory_Animate.java (r9789)

Postby friarsol » 17 Aug 2011, 01:10

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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Code duplication @ AbilityFactory_Animate.java (r9789)

Postby Braids » 17 Aug 2011, 01:21

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.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. ;)
User avatar
Braids
Programmer
 
Posts: 556
Joined: 22 Jun 2011, 00:39
Location: Unknown. Hobby: Driving myself and others to constructive madness.
Has thanked: 1 time
Been thanked: 1 time


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 40 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 40 users online :: 0 registered, 0 hidden and 40 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 40 guests

Login Form