From 62d4d70eeae0c8e93c4672db2c2cc6d73dd863bd Mon Sep 17 00:00:00 2001 From: Sehyeon Date: Wed, 26 Mar 2025 22:27:36 +0900 Subject: [PATCH] =?UTF-8?q?DO-54=20[Style]=20=EC=95=88=EC=93=B0=EB=8A=94?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Renju/RenjuForbiddenMoveDetector.cs | 65 +------------------ 1 file changed, 2 insertions(+), 63 deletions(-) diff --git a/Assets/Script/Renju/RenjuForbiddenMoveDetector.cs b/Assets/Script/Renju/RenjuForbiddenMoveDetector.cs index c9575f6..4810e48 100644 --- a/Assets/Script/Renju/RenjuForbiddenMoveDetector.cs +++ b/Assets/Script/Renju/RenjuForbiddenMoveDetector.cs @@ -77,74 +77,13 @@ public class RenjuForbiddenMoveDetector : ForbiddenDetectorBase return forbiddenMoves; } - private bool HasWinningPotential(Enums.PlayerType[,] board, int row, int col) - { - // 모든 방향에 대해 5개 연속 돌을 만들 수 있는지 확인 - for (int dirPair = 0; dirPair < 4; dirPair++) - { - int dir1 = DirectionPairs[dirPair, 0]; - int dir2 = DirectionPairs[dirPair, 1]; - - if (CanFormFiveInDirection(board, row, col, dir1, dir2)) - { - return true; - } - } - - return false; - } - - private bool CanFormFiveInDirection(Enums.PlayerType[,] board, int row, int col, int dir1, int dir2) - { - // 해당 방향으로 5개 연속 돌을 놓을 가능성 확인 - // 현재 위치에 흑돌 임시 배치 - board[row, col] = Black; - - // 양방향으로 연속된 돌 또는 빈 공간 개수 세기 - int length = 1; // 현재 위치 포함 - - // dir1 방향 확인 - for (int i = 1; i < 5; i++) - { - int newRow = row + Directions[dir1, 0] * i; - int newCol = col + Directions[dir1, 1] * i; - - if (!IsInBounds(newRow, newCol) || board[newRow, newCol] == White) - { - break; - } - - length++; - } - - // dir2 방향 확인 - for (int i = 1; i < 5; i++) - { - int newRow = row + Directions[dir2, 0] * i; - int newCol = col + Directions[dir2, 1] * i; - - if (!IsInBounds(newRow, newCol) || board[newRow, newCol] == White) - { - break; - } - - length++; - } - - // 원래 상태로 복원 - board[row, col] = Space; - - // 5개 이상 연속 가능하면 승리 가능성 있음 - return length >= 5; - } - private bool SimulateDoubleFour(Enums.PlayerType[,] board) { for (int row = 0; row < BoardSize; row++) { for (int col = 0; col < BoardSize; col++) { - if (board[row, col] != Space) + if (board[row, col] != Space) // 보드 초기화 방지용 continue; if (_doubleFourDetactor.IsDoubleFour(board, row, col)) @@ -160,7 +99,7 @@ public class RenjuForbiddenMoveDetector : ForbiddenDetectorBase { for (int col = 0; col < BoardSize; col++) { - if (board[row, col] != Space) + if (board[row, col] != Space) // 보드 초기화 방지용 continue; if (_overlineDetactor.IsOverline(board, row, col))