Show "Waiting for opponent..." while you wait for the other player to choose whether to go first or keep their first hand

This commit is contained in:
drdev
2015-06-13 19:12:39 +00:00
parent c1c427d31e
commit 3e6d5cd3e9
5 changed files with 29 additions and 0 deletions

View File

@@ -872,4 +872,13 @@ public class PlayerControllerAi extends PlayerController {
public void autoPassCancel() {
// Do nothing
}
@Override
public void awaitNextInput() {
// Do nothing
}
@Override
public void cancelAwaitNextInput() {
// Do nothing
}
}

View File

@@ -1486,6 +1486,11 @@ public class GameAction {
goesFirst = game.getPlayers().get(0); // does not really matter who plays first - it's controlled from the same computer.
}
for (Player p : game.getPlayers()) {
if (p != goesFirst) {
p.getController().awaitNextInput(); //show "Waiting for opponent..." while first player chooses whether to go first or keep their hand
}
}
goesFirst = goesFirst.getController().chooseStartingPlayer(isFirstGame);
return goesFirst;
}

View File

@@ -229,6 +229,10 @@ public abstract class PlayerController {
public abstract void autoPassCancel();
public abstract void awaitNextInput();
public abstract void cancelAwaitNextInput();
public boolean isGuiPlayer() {
return false;
}

View File

@@ -659,4 +659,13 @@ public class PlayerControllerForTests extends PlayerController {
public void autoPassCancel() {
// Not used by the controller for tests
}
@Override
public void awaitNextInput() {
// Not used by the controller for tests
}
@Override
public void cancelAwaitNextInput() {
// Not used by the controller for tests
}
}

View File

@@ -1813,9 +1813,11 @@ public class PlayerControllerHuman
public void autoPassCancel() {
getGui().autoPassCancel(getLocalPlayerView());
}
@Override
public void awaitNextInput() {
getGui().awaitNextInput();
}
@Override
public void cancelAwaitNextInput() {
getGui().cancelAwaitNextInput();
}