빌드 오류 수정
This commit is contained in:
parent
ba7850d241
commit
3d35b51a1d
@ -41,7 +41,7 @@ export default function ChessGame({ gameMode = GameMode.CLASSIC }: ChessGameProp
|
||||
} else {
|
||||
setValidMoves([])
|
||||
}
|
||||
}, [selectedPiece, board, currentPlayer])
|
||||
}, [selectedPiece, board, currentPlayer, gameMode])
|
||||
|
||||
// Check for game end conditions after each move
|
||||
useEffect(() => {
|
||||
@ -92,7 +92,6 @@ export default function ChessGame({ gameMode = GameMode.CLASSIC }: ChessGameProp
|
||||
// Update captured pieces if a piece was captured
|
||||
if (result.capturedPiece) {
|
||||
setCapturedPieces((prev) => {
|
||||
const oppositeColor = currentPlayer === PieceColor.WHITE ? PieceColor.BLACK : PieceColor.WHITE
|
||||
return {
|
||||
...prev,
|
||||
[currentPlayer]: [...prev[currentPlayer], result.capturedPiece],
|
||||
|
||||
@ -28,7 +28,7 @@ export default function GameInfo({ currentPlayer, gameStatus, moveHistory, captu
|
||||
<div
|
||||
className={`w-4 h-4 rounded-full ${currentPlayer === PieceColor.WHITE ? "bg-white border border-gray-300" : "bg-black"}`}
|
||||
></div>
|
||||
<span className="font-medium">{currentPlayer === PieceColor.WHITE ? "White" : "Black"}'s turn</span>
|
||||
<span className="font-medium">{currentPlayer === PieceColor.WHITE ? "White" : "Black"}'s turn</span>
|
||||
</div>
|
||||
|
||||
{gameStatus === "ongoing" ? (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user