Allow toggling between Open and AI

This commit is contained in:
drdev
2015-05-31 23:55:29 +00:00
parent aa6856d376
commit 15d9773c1b
4 changed files with 51 additions and 48 deletions

View File

@@ -11,7 +11,7 @@ import forge.match.LobbySlotType;
//Temporary lobby instance to use for OnlineLobby before connecting to a server
public final class OfflineLobby extends GameLobby {
public OfflineLobby() {
super(false);
super(true);
final String humanName = localName();
final int[] avatarIndices = localAvatarIndices();

View File

@@ -42,24 +42,29 @@ public final class ServerGameLobby extends GameLobby {
updateView(false);
}
@Override public boolean hasControl() {
@Override
public boolean hasControl() {
return true;
}
@Override public boolean mayEdit(final int index) {
@Override
public boolean mayEdit(final int index) {
final LobbySlotType type = getSlot(index).getType();
return type != LobbySlotType.REMOTE && type != LobbySlotType.OPEN;
}
@Override public boolean mayControl(final int index) {
@Override
public boolean mayControl(final int index) {
return getSlot(index).getType() != LobbySlotType.REMOTE;
}
@Override public boolean mayRemove(final int index) {
@Override
public boolean mayRemove(final int index) {
return true;
}
@Override protected IGuiGame getGui(final int index) {
@Override
protected IGuiGame getGui(final int index) {
return FServerManager.getInstance().getGui(index);
}