From b18edb680d43d47794a237c9c27bef2e3138d51e Mon Sep 17 00:00:00 2001 From: Lim0_C Date: Thu, 20 Mar 2025 15:35:00 +0900 Subject: [PATCH] =?UTF-8?q?DO-41=20[Cmoment]=20=EB=AC=B4=EC=8A=B9=EB=B6=80?= =?UTF-8?q?=20=EA=B4=80=EB=A0=A8=20=EC=BD=94=EB=93=9C=20=EC=A3=BC=EC=84=9D?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Script/Game/GameLogic.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Script/Game/GameLogic.cs b/Assets/Script/Game/GameLogic.cs index fdea953..9462648 100644 --- a/Assets/Script/Game/GameLogic.cs +++ b/Assets/Script/Game/GameLogic.cs @@ -387,7 +387,7 @@ public class GameLogic : MonoBehaviour { return _board; } - + //무승부 확인 public bool CheckGameDraw(Enums.PlayerType[,] board) { if (CheckIsFull(board)) return true; // 빈 칸이 없으면 무승부 @@ -396,6 +396,7 @@ public class GameLogic : MonoBehaviour return !(playerAHasChance || playerBHasChance); // 둘 다 기회가 없으면 무승부 } + //연속되는 5개가 만들어질 기회가 있는지 판단 private bool CheckFiveChance(Enums.PlayerType[,] board, Enums.PlayerType player) { var tempBoard = (Enums.PlayerType[,])board.Clone(); @@ -411,14 +412,13 @@ public class GameLogic : MonoBehaviour var (count, _) = CountStones(tempBoard, row, col, dir, player); // 자기 자신 포함하여 5개 이상일 시 true 반환 - if (count + 1 >= WIN_COUNT) - return true; + if (count + 1 >= WIN_COUNT) return true; } } } return false; } - + //보드가 꽉 찼는지 확인 private static bool CheckIsFull(Enums.PlayerType[,] board) { int size = board.GetLength(0);