빌드 오류 수정

This commit is contained in:
Ayuriel 2025-05-31 23:44:23 +09:00
parent ba7850d241
commit 3d35b51a1d
2 changed files with 2 additions and 3 deletions

View File

@ -41,7 +41,7 @@ export default function ChessGame({ gameMode = GameMode.CLASSIC }: ChessGameProp
} else { } else {
setValidMoves([]) setValidMoves([])
} }
}, [selectedPiece, board, currentPlayer]) }, [selectedPiece, board, currentPlayer, gameMode])
// Check for game end conditions after each move // Check for game end conditions after each move
useEffect(() => { useEffect(() => {
@ -92,7 +92,6 @@ export default function ChessGame({ gameMode = GameMode.CLASSIC }: ChessGameProp
// Update captured pieces if a piece was captured // Update captured pieces if a piece was captured
if (result.capturedPiece) { if (result.capturedPiece) {
setCapturedPieces((prev) => { setCapturedPieces((prev) => {
const oppositeColor = currentPlayer === PieceColor.WHITE ? PieceColor.BLACK : PieceColor.WHITE
return { return {
...prev, ...prev,
[currentPlayer]: [...prev[currentPlayer], result.capturedPiece], [currentPlayer]: [...prev[currentPlayer], result.capturedPiece],

View File

@ -28,7 +28,7 @@ export default function GameInfo({ currentPlayer, gameStatus, moveHistory, captu
<div <div
className={`w-4 h-4 rounded-full ${currentPlayer === PieceColor.WHITE ? "bg-white border border-gray-300" : "bg-black"}`} className={`w-4 h-4 rounded-full ${currentPlayer === PieceColor.WHITE ? "bg-white border border-gray-300" : "bg-black"}`}
></div> ></div>
<span className="font-medium">{currentPlayer === PieceColor.WHITE ? "White" : "Black"}'s turn</span> <span className="font-medium">{currentPlayer === PieceColor.WHITE ? "White" : "Black"}&apos;s turn</span>
</div> </div>
{gameStatus === "ongoing" ? ( {gameStatus === "ongoing" ? (