Code duplication @ AbilityFactory_Animate.java (r9789)
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
4 posts
• Page 1 of 1
Code duplication @ AbilityFactory_Animate.java (r9789)
by 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.
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)
by 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. 

-
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)
by friarsol » 17 Aug 2011, 01:10
Generally how I look for cards is put a "$ " before the terminology.Braids wrote:do you know which cards use these methods? i'm thinking about testing here.
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)
by Braids » 17 Aug 2011, 01:21
thanks be to the good friar!friarsol wrote:. . .So "$ Animate" yields me results like Ancient Kavu and Animate Land.
and "$ AnimateAll" yields me results like Mirror Entity and Natural Affinity.
@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. 

-
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
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 38 guests