Skip to content

Commit f423ae9

Browse files
committed
self-play: single agree ends the game
1 parent 4b2292d commit f423ae9

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/main/client/src/feature/game/GamePanel.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function Panel({gameState, setGameState}) {
128128
</div>
129129
)}
130130
{!isKibitz(gameState, auth) && !gameHasEnded(gameState) && (
131-
<div className="flex-none">
131+
<div className="mt-1 flex-none">
132132
<Button
133133
onClick={onPass}
134134
className="py-1 px-4"
@@ -138,17 +138,15 @@ function Panel({gameState, setGameState}) {
138138
</div>
139139
)}
140140
{!isKibitz(gameState, auth) && !gameHasEnded(gameState) && counting && <>
141-
<div className="flex-none">
141+
<div className="mt-1 flex-none flex gap-x-1">
142142
<Button
143143
className="py-1 px-4"
144144
disabled={gameHasEnded(gameState)}
145145
onClick={onResetCounting}>
146146
Reset Counting
147147
</Button>
148-
</div>
149-
<div className="flex-none">
150148
<Button
151-
disabled={(!isSelfPlay(gameState) && countingAgreed(gameState)) || !countingComplete(gameState)}
149+
disabled={countingAgreed(gameState) || !countingComplete(gameState)}
152150
className="py-1 px-4"
153151
onClick={onCountingAgree}>
154152
OK

src/main/java/com/bernd/model/Game.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public Game update(Move move) {
3838
}
3939

4040
private Game updateInternal(Move move) {
41-
if (move.agreeCounting() && (countingAgreed() | move.color()) == COLORS) {
41+
if (move.agreeCounting() && (isSelfPlay() || (countingAgreed() | move.color()) == COLORS)) {
4242
moves.addGameEndMarker();
4343
} else {
4444
moves.add(move);

0 commit comments

Comments
 (0)