mirror of
https://github.com/correl/mage.git
synced 2024-11-28 11:09:54 +00:00
* Fixed some problems for handling concede during game init.
This commit is contained in:
parent
5a9671cbca
commit
0d46c68924
3 changed files with 11 additions and 5 deletions
|
@ -161,10 +161,9 @@ public class ComputerPlayer7 extends ComputerPlayer6 {
|
||||||
Game sim = createSimulation(game);
|
Game sim = createSimulation(game);
|
||||||
SimulationNode2.resetCount();
|
SimulationNode2.resetCount();
|
||||||
root = new SimulationNode2(null, sim, maxDepth, playerId);
|
root = new SimulationNode2(null, sim, maxDepth, playerId);
|
||||||
|
|
||||||
addActionsTimed();
|
addActionsTimed();
|
||||||
|
if (root.children != null && !root.children.isEmpty()) {
|
||||||
logger.trace("After add actions timed: root.children.size = " + root.children.size());
|
logger.trace("After add actions timed: root.children.size = " + root.children.size());
|
||||||
if (!root.children.isEmpty()) {
|
|
||||||
root = root.children.get(0);
|
root = root.children.get(0);
|
||||||
// int bestScore = root.getScore();
|
// int bestScore = root.getScore();
|
||||||
// if (bestScore > currentScore || allowBadMoves) {
|
// if (bestScore > currentScore || allowBadMoves) {
|
||||||
|
|
|
@ -205,9 +205,11 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
response.clear();
|
response.clear();
|
||||||
|
if (isInGame()) {
|
||||||
loop = true;
|
loop = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (recordingMacro && !macroTriggeredSelectionFlag) {
|
if (recordingMacro && !macroTriggeredSelectionFlag) {
|
||||||
// logger.info("Adding an action " + response);
|
// logger.info("Adding an action " + response);
|
||||||
actionQueueSaved.add(new PlayerResponse(response));
|
actionQueueSaved.add(new PlayerResponse(response));
|
||||||
|
|
|
@ -563,7 +563,12 @@ public abstract class GameImpl implements Game, Serializable {
|
||||||
// }
|
// }
|
||||||
@Override
|
@Override
|
||||||
public void setConcedingPlayer(UUID playerId) {
|
public void setConcedingPlayer(UUID playerId) {
|
||||||
Player player = getPlayer(state.getPriorityPlayerId());
|
Player player = null;
|
||||||
|
if (state.getChoosingPlayerId() != null) {
|
||||||
|
player = getPlayer(state.getChoosingPlayerId());
|
||||||
|
} else if (state.getPriorityPlayerId() != null) {
|
||||||
|
player = getPlayer(state.getPriorityPlayerId());
|
||||||
|
}
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
if (!player.hasLeft() && player.isHuman()) {
|
if (!player.hasLeft() && player.isHuman()) {
|
||||||
if (!concedingPlayers.contains(playerId)) {
|
if (!concedingPlayers.contains(playerId)) {
|
||||||
|
|
Loading…
Reference in a new issue