r17789
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
3 posts
• Page 1 of 1
r17789
by Max mtg » 30 Oct 2012, 12:44
A whole function instead of allowedSetCodes.clear();RumbleBBU wrote:http://svn.slightlymagic.net/websvn/dif ... &peg=17789
- Code: Select all
/**
* Empty the whole list.
*/
public void emptyAllowedSets() {
if (allowedSetCodes != null) {
while (!allowedSetCodes.isEmpty()) {
allowedSetCodes.remove(0);
}
}
}
make it final:
- Code: Select all
private final List<String> allowedSetCodes = new ArrayList<String>();
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: r17789
by Max mtg » 30 Oct 2012, 12:51
http://svn.slightlymagic.net/websvn/dif ... &peg=17789
There are already all decks loaded in memory. If you are giving user freedom to choose his deck, then should not restrict on sealed. If you want him to use limited mode only decks - then do use Singeltons.gteModel().getDecks().get(Draft-or-Sealed) to give a list to choose from.
There are already all decks loaded in memory. If you are giving user freedom to choose his deck, then should not restrict on sealed. If you want him to use limited mode only decks - then do use Singeltons.gteModel().getDecks().get(Draft-or-Sealed) to give a list to choose from.
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: r17789
by RumbleBBU » 30 Oct 2012, 13:36
1. The unnecessary loop: good catch. Missed that one when cleaning up my files before the commit.
2. The null check: I have a habit of putting in paranoia checks like this (even when they are technically unnecessary, i.e., when they should always be false). It's a habit that is difficult to unlearn.
3. The decks in memory: you're probably right. I'll change that when I have time.
2. The null check: I have a habit of putting in paranoia checks like this (even when they are technically unnecessary, i.e., when they should always be false). It's a habit that is difficult to unlearn.
3. The decks in memory: you're probably right. I'll change that when I have time.
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 9 guests