Refactor creation of Gui and AI lobby players into GamePlayerUtil

Fix so gui player name updated
Fix so multiple human players receive separate LobbyPlayerHuman instances
This commit is contained in:
drdev
2014-09-15 22:26:55 +00:00
parent e658588771
commit 42b99b0b5e
34 changed files with 147 additions and 189 deletions

View File

@@ -1,5 +1,7 @@
package forge;
import org.apache.commons.lang3.StringUtils;
/**
* This means a player's part unchanged for all games.
*
@@ -7,11 +9,9 @@ package forge;
*
*/
public abstract class LobbyPlayer {
protected final String name;
protected String name;
private int avatarIndex = -1;
public LobbyPlayer(String name) {
this.name = name;
}
@@ -19,6 +19,10 @@ public abstract class LobbyPlayer {
public String getName() {
return name;
}
public void setName(String name0) {
if (StringUtils.isEmpty(name0)) { return; } //don't allow setting name to nothing
name = name0;
}
@Override
public int hashCode() {