mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Allow Human vs Human games in GUI refactoring, plus some minor fixes.
This commit is contained in:
@@ -449,6 +449,14 @@ public enum FControl implements KeyEventDispatcher {
|
||||
this.game = match.createGame();
|
||||
inputQueue = new InputQueue(game);
|
||||
|
||||
boolean anyPlayerIsAi = false;
|
||||
for (final Player p : game.getPlayers()) {
|
||||
if (p.getLobbyPlayer() instanceof LobbyPlayerAi) {
|
||||
anyPlayerIsAi = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
final LobbyPlayer me = getGuiPlayer();
|
||||
for (final Player p : game.getPlayers()) {
|
||||
if (p.getLobbyPlayer().equals(me)) {
|
||||
@@ -459,6 +467,17 @@ public enum FControl implements KeyEventDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
if (!anyPlayerIsAi) {
|
||||
// If there are no AI's, allow all players to see all cards (hotseat
|
||||
// mode).
|
||||
for (final Player p : game.getPlayers()) {
|
||||
if (p.getController() instanceof PlayerControllerHuman) {
|
||||
final PlayerControllerHuman controller = (PlayerControllerHuman) p.getController();
|
||||
controller.setMayLookAtAllCards(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.gameView == null) {
|
||||
// Watch game but do not participate
|
||||
final LocalGameView gameView = new LocalGameView(game);
|
||||
|
||||
Reference in New Issue
Block a user