Combat.java - wrong implementation
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
3 posts
• Page 1 of 1
Combat.java - wrong implementation
by Max mtg » 03 Aug 2013, 20:18
- Code: Select all
private List<Card> combatantDealtFirstStrikeDamage = Lists.newArrayList();
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: Combat.java - wrong implementation
by friarsol » 04 Aug 2013, 03:36
No, it doesn't. It refers to whether a Card assigned damage during the first strike damage, not whether it received damage. It's needed in the Combat class to determine if a creature will deal damage in the non-first strike damage, since before this we were incorrectly just checking if creatures had first strike, which is not correct since if a creature gains or loses first strike it wouldn't correctly assign damage the second time.Max mtg wrote:Should not be in Combat class. It refers to card damage history if a card was dealt first-strike damage.
- Code: Select all
private List<Card> combatantDealtFirstStrikeDamage = Lists.newArrayList();
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Combat.java - wrong implementation
by Max mtg » 04 Aug 2013, 07:50
You are right then.
I have slightly renamed the field and added a comment to prevent other people from making wrong conclusions about this code.
I have slightly renamed the field and added a comment to prevent other people from making wrong conclusions about this code.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 60 guests