Merge branch 'main' into DO-37-상점-광고-기능
This commit is contained in:
commit
a9bd5a5364
@ -2,4 +2,5 @@
|
||||
{
|
||||
public const string ServerURL = "http://localhost:3000";
|
||||
public const string GameServerURL = "ws://localhost:3000";
|
||||
public const int BoardSize = 15;
|
||||
}
|
@ -142,6 +142,15 @@ public class GameLogic : MonoBehaviour
|
||||
public int selectedRow;
|
||||
public int selectedCol;
|
||||
//마지막 배치된 좌표
|
||||
|
||||
#region Renju Members
|
||||
// 렌주룰 금수 검사기
|
||||
private RenjuForbiddenMoveDetector _forbiddenDetector;
|
||||
|
||||
// 현재 금수 위치 목록
|
||||
private List<Vector2Int> _forbiddenMoves = new List<Vector2Int>();
|
||||
#endregion
|
||||
|
||||
private int _lastRow;
|
||||
private int _lastCol;
|
||||
|
||||
@ -163,6 +172,11 @@ public class GameLogic : MonoBehaviour
|
||||
selectedRow = -1;
|
||||
selectedCol = -1;
|
||||
|
||||
#region Renju Init
|
||||
// 금수 감지기 초기화
|
||||
_forbiddenDetector = new RenjuForbiddenMoveDetector();
|
||||
#endregion
|
||||
|
||||
_lastRow = -1;
|
||||
_lastCol = -1;
|
||||
//timer 초기화
|
||||
@ -190,6 +204,7 @@ public class GameLogic : MonoBehaviour
|
||||
|
||||
//TODO: 기보 매니저에게 플레이어 닉네임 넘겨주기
|
||||
ReplayManager.Instance.InitReplayData("PlayerA","nicknameB");
|
||||
|
||||
|
||||
switch (gameType)
|
||||
{
|
||||
@ -232,6 +247,12 @@ public class GameLogic : MonoBehaviour
|
||||
|
||||
public void SetStoneSelectedState(int row, int col)
|
||||
{
|
||||
|
||||
#region Renju Turn Set
|
||||
// 턴이 변경될 때마다 금수 위치 업데이트
|
||||
UpdateForbiddenMoves();
|
||||
#endregion
|
||||
|
||||
if (_board[row, col] != Enums.PlayerType.None) return;
|
||||
|
||||
if (stoneController.GetStoneState(row, col) != Enums.StoneState.None && currentTurn == Enums.PlayerType.PlayerA) return;
|
||||
@ -354,4 +375,36 @@ public class GameLogic : MonoBehaviour
|
||||
|
||||
return (count, openEnds);
|
||||
}
|
||||
|
||||
#region Renju Rule Detector
|
||||
// 금수 위치 업데이트 및 표시
|
||||
private void UpdateForbiddenMoves()
|
||||
{
|
||||
ClearForbiddenMarks();
|
||||
|
||||
if (currentTurn == Enums.PlayerType.PlayerA)
|
||||
{
|
||||
_forbiddenMoves = _forbiddenDetector.RenjuForbiddenMove(_board);
|
||||
|
||||
foreach (var pos in _forbiddenMoves)
|
||||
{
|
||||
SetStoneNewState(Enums.StoneState.Blocked, pos.x, pos.y);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 이전에 표시된 금수 마크 제거
|
||||
private void ClearForbiddenMarks()
|
||||
{
|
||||
foreach (var forbiddenMove in _forbiddenMoves)
|
||||
{
|
||||
Vector2Int pos = forbiddenMove;
|
||||
if (_board[pos.x, pos.y] == Enums.PlayerType.None)
|
||||
{
|
||||
SetStoneNewState(Enums.StoneState.None, pos.x, pos.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
3
Assets/Script/Renju.meta
Normal file
3
Assets/Script/Renju.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e453dac194545d582fc99e19ea52a4f
|
||||
timeCreated: 1741960614
|
49
Assets/Script/Renju/ForbiddenDetectorBase.cs
Normal file
49
Assets/Script/Renju/ForbiddenDetectorBase.cs
Normal file
@ -0,0 +1,49 @@
|
||||
public class ForbiddenDetectorBase
|
||||
{
|
||||
private protected Enums.PlayerType Black = Enums.PlayerType.PlayerA;
|
||||
private protected Enums.PlayerType Space = Enums.PlayerType.None;
|
||||
|
||||
// 8방향을 나타내는 델타 배열 (가로, 세로, 대각선 방향)
|
||||
private protected readonly int[,] Directions = new int[8, 2]
|
||||
{
|
||||
{ 1, 0 }, // 오른쪽
|
||||
{ 1, 1 }, // 오른쪽 아래
|
||||
{ 0, 1 }, // 아래
|
||||
{ -1, 1 }, // 왼쪽 아래
|
||||
{ -1, 0 }, // 왼쪽
|
||||
{ -1, -1 }, // 왼쪽 위
|
||||
{ 0, -1 }, // 위
|
||||
{ 1, -1 } // 오른쪽 위
|
||||
};
|
||||
|
||||
// 방향 쌍을 정의 (반대 방향끼리 쌍을 이룸)
|
||||
// 0-4: 가로 방향 쌍 (동-서)
|
||||
// 1-5: 대각선 방향 쌍 (남동-북서)
|
||||
// 2-6: 세로 방향 쌍 (남-북)
|
||||
// 3-7: 대각선 방향 쌍 (남서-북동)
|
||||
private protected readonly int[,] DirectionPairs = { { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 } };
|
||||
|
||||
// 15*15 보드 사이즈
|
||||
private protected int BoardSize = Constants.BoardSize;
|
||||
|
||||
/// <summary>
|
||||
/// 좌표가 보드 범위 내에 있는지 확인
|
||||
/// </summary>
|
||||
private protected bool IsInBounds(int row, int col)
|
||||
{
|
||||
var inBoardSizeRow = row >= 0 && row < BoardSize;
|
||||
var inBoardSizeCol = col >= 0 && col < BoardSize;
|
||||
|
||||
return inBoardSizeRow && inBoardSizeCol;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 해당 위치가 비어있는지 확인
|
||||
/// </summary>
|
||||
private protected bool IsEmptyPosition(Enums.PlayerType[,] board, int row, int col)
|
||||
{
|
||||
if (!IsInBounds(row, col)) return false;
|
||||
|
||||
return board[row, col] == Space;
|
||||
}
|
||||
}
|
3
Assets/Script/Renju/ForbiddenDetectorBase.cs.meta
Normal file
3
Assets/Script/Renju/ForbiddenDetectorBase.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b1d1da5571994d3cbe7d3e0c342fd7e3
|
||||
timeCreated: 1741960754
|
194
Assets/Script/Renju/RenjuDoubleFourDetector.cs
Normal file
194
Assets/Script/Renju/RenjuDoubleFourDetector.cs
Normal file
@ -0,0 +1,194 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
public class RenjuDoubleFourDetector: ForbiddenDetectorBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 쌍사 여부를 검사합니다.
|
||||
/// </summary>
|
||||
/// <param name="board">현재 보드 상태</param>
|
||||
/// <param name="row">행 (y 좌표)</param>
|
||||
/// <param name="col">열 (x 좌표)</param>
|
||||
/// <returns>쌍사면 true, 아니면 false</returns>
|
||||
public bool IsDoubleFour(Enums.PlayerType[,] board, int row, int col)
|
||||
{
|
||||
// 임시로 돌 배치
|
||||
board[row, col] = Black;
|
||||
|
||||
// 쌍사 검사
|
||||
bool isDoubleFour = CheckDoubleFour(board, row, col);
|
||||
|
||||
// 원래 상태로 되돌림
|
||||
board[row, col] = Space;
|
||||
|
||||
return isDoubleFour;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 쌍사(4-4) 여부를 검사합니다.
|
||||
/// </summary>
|
||||
private bool CheckDoubleFour(Enums.PlayerType[,] board, int row, int col)
|
||||
{
|
||||
// 각각 두개의 라인에서 쌍사를 형성하는 경우
|
||||
if (FindDoubleLineFour(board, row, col)) return true;
|
||||
|
||||
// true : 일직선으로 쌍사가 만들어지는 특수 패턴
|
||||
// false : 모든 경우에도 쌍사가 만들어지지 않음
|
||||
return FindSingleLineDoubleFour(board, row, col);
|
||||
}
|
||||
|
||||
private bool FindDoubleLineFour(Enums.PlayerType[,] board, int row, int col)
|
||||
{
|
||||
int fourCount = 0;
|
||||
|
||||
// 4개의 방향 쌍에 대해 검사 (대각선 및 직선 포함)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int dir1 = DirectionPairs[i, 0];
|
||||
int dir2 = DirectionPairs[i, 1];
|
||||
|
||||
// 4가 몇 개 만들어지는지 확인
|
||||
if (CheckFourInDirection(board, row, col, dir1, dir2))
|
||||
{
|
||||
fourCount++;
|
||||
|
||||
// 이미 4가 2개 이상 발견되면 쌍사로 판정
|
||||
if (fourCount >= 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool FindSingleLineDoubleFour(Enums.PlayerType[,] board, int row, int col)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int dir1 = DirectionPairs[i, 0];
|
||||
int dir2 = DirectionPairs[i, 1];
|
||||
|
||||
// 각 방향 라인 패턴
|
||||
Enums.PlayerType[] linePattern = ExtractLinePattern(board, row, col, dir1, dir2);
|
||||
|
||||
// 패턴을 문자열로 변환
|
||||
StringBuilder temp = new StringBuilder();
|
||||
foreach (var cell in linePattern)
|
||||
{
|
||||
temp.Append(cell switch
|
||||
{
|
||||
Enums.PlayerType.None => "□",
|
||||
Enums.PlayerType.PlayerA => "●",
|
||||
Enums.PlayerType.PlayerB => "○",
|
||||
_ => "?"
|
||||
});
|
||||
}
|
||||
|
||||
string patternStr = temp.ToString();
|
||||
|
||||
// 한줄로 발생하는 쌍사 패턴 검사
|
||||
if (patternStr.Contains("●●□●●□●●") || patternStr.Contains("●□●●●□●"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 특정 방향에서 4가 형성되는지 확인합니다.
|
||||
/// 떨어져 있는 돌도 고려합니다 (한 칸 또는 두 칸 떨어진 패턴 포함).
|
||||
/// </summary>
|
||||
private bool CheckFourInDirection(Enums.PlayerType[,] board, int row, int col, int dir1, int dir2)
|
||||
{
|
||||
// 각 방향으로 최대 5칸까지의 범위를 검사 (현재 위치 포함 총 11칸)
|
||||
Enums.PlayerType[] linePattern = ExtractLinePattern(board, row, col, dir1, dir2);
|
||||
int centerIndex = 5; // 중앙 인덱스 (현재 위치)
|
||||
|
||||
// 모든 가능한 패턴 확인
|
||||
return CheckFourOneGap(linePattern, centerIndex);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 라인 패턴을 추출합니다. (중복 코드를 방지하기 위한 헬퍼 메서드)
|
||||
/// </summary>
|
||||
private Enums.PlayerType[] ExtractLinePattern(Enums.PlayerType[,] board, int row, int col, int dir1, int dir2)
|
||||
{
|
||||
Enums.PlayerType[] linePattern = new Enums.PlayerType[11];
|
||||
int centerIndex = 5; // 중앙 인덱스 (현재 위치)
|
||||
|
||||
// 현재 위치 설정
|
||||
linePattern[centerIndex] = Black;
|
||||
|
||||
// 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))
|
||||
{
|
||||
linePattern[centerIndex + i] = board[newRow, newCol];
|
||||
}
|
||||
else
|
||||
{
|
||||
linePattern[centerIndex + i] = Space; // 범위 밖은 빈칸으로 처리
|
||||
}
|
||||
}
|
||||
|
||||
// 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))
|
||||
{
|
||||
linePattern[centerIndex - i] = board[newRow, newCol];
|
||||
}
|
||||
else
|
||||
{
|
||||
linePattern[centerIndex - i] = Space; // 범위 밖은 빈칸으로 처리
|
||||
}
|
||||
}
|
||||
|
||||
return linePattern;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 한 칸 떨어진 4 패턴을 확인합니다.
|
||||
/// </summary>
|
||||
private bool CheckFourOneGap(Enums.PlayerType[] linePattern, int centerIndex)
|
||||
{
|
||||
// 윈도우 슬라이딩으로 연속된 5칸을 검사 (한 칸 떨어진 패턴을 위해)
|
||||
for (int start = 0; start <= 5; start++)
|
||||
{
|
||||
// 현재 위치가 이 윈도우에 포함되는지 확인
|
||||
bool currentPositionInWindow = (start <= centerIndex && centerIndex < start + 5);
|
||||
if (!currentPositionInWindow) continue;
|
||||
|
||||
// 윈도우 내의 돌 개수 세기
|
||||
int stoneCount = 0;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
if (linePattern[start + i] == Black)
|
||||
{
|
||||
stoneCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// 정확히 4개의 돌이 있고, 1개의 빈칸이 있으면 4로 판정
|
||||
// (현재 위치는 흑으로 이미 설정되어 있음)
|
||||
if (stoneCount == 4)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
3
Assets/Script/Renju/RenjuDoubleFourDetector.cs.meta
Normal file
3
Assets/Script/Renju/RenjuDoubleFourDetector.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0daf1f2b8cbe4b19adc0e42db7a15991
|
||||
timeCreated: 1742270734
|
26
Assets/Script/Renju/RenjuDoubleThreeDetector.cs
Normal file
26
Assets/Script/Renju/RenjuDoubleThreeDetector.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class RenjuDoubleThreeDetector: ForbiddenDetectorBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 쌍삼(3-3) 여부를 검사합니다.
|
||||
/// </summary>
|
||||
/// <param name="board">현재 보드 상태</param>
|
||||
/// <param name="row">행 좌표</param>
|
||||
/// <param name="col">열 좌표</param>
|
||||
/// <returns>쌍삼이면 true, 아니면 false</returns>
|
||||
public bool IsDoubleThree(Enums.PlayerType[,] board, int row, int col)
|
||||
{
|
||||
// 임시로 돌 배치
|
||||
board[row, col] = Black;
|
||||
|
||||
// 쌍삼 검사
|
||||
// bool isThreeThree = CheckThreeThree(board, row, col);
|
||||
|
||||
// 원래 상태로 되돌림
|
||||
board[row, col] = Space;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
3
Assets/Script/Renju/RenjuDoubleThreeDetector.cs.meta
Normal file
3
Assets/Script/Renju/RenjuDoubleThreeDetector.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1c3d6cdb2557431f82e7997bc5ad685c
|
||||
timeCreated: 1742283793
|
19
Assets/Script/Renju/RenjuForbiddenMoveDetector.cs
Normal file
19
Assets/Script/Renju/RenjuForbiddenMoveDetector.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
public class RenjuForbiddenMoveDetector
|
||||
{
|
||||
// 렌주 룰 금수 감지기 생성
|
||||
private RenjuRuleChecker _ruleChecker = new RenjuRuleChecker();
|
||||
|
||||
/// <summary>
|
||||
/// 렌주 룰로 금수 리스트를 반환하는 함수
|
||||
/// </summary>
|
||||
/// <param name="board">현재 보드의 상태</param>
|
||||
/// <returns>금수 좌표를 담은 리스트</returns>
|
||||
public List<Vector2Int> RenjuForbiddenMove(Enums.PlayerType[,] board)
|
||||
{
|
||||
return _ruleChecker.GetForbiddenMoves(board);
|
||||
}
|
||||
}
|
3
Assets/Script/Renju/RenjuForbiddenMoveDetector.cs.meta
Normal file
3
Assets/Script/Renju/RenjuForbiddenMoveDetector.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8618553c3e244abdb040fb7378dd4b65
|
||||
timeCreated: 1741939566
|
101
Assets/Script/Renju/RenjuOverlineDetector.cs
Normal file
101
Assets/Script/Renju/RenjuOverlineDetector.cs
Normal file
@ -0,0 +1,101 @@
|
||||
public class RenjuOverlineDetector : ForbiddenDetectorBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 장목 여부를 검사합니다.
|
||||
/// </summary>
|
||||
/// <param name="board">현재 보드 상태</param>
|
||||
/// <param name="row">행 (y 좌표)</param>
|
||||
/// <param name="col">열 (x 좌표)</param>
|
||||
/// <returns>장목이면 true, 아니면 false</returns>
|
||||
public bool IsOverline(Enums.PlayerType[,] board, int row, int col)
|
||||
{
|
||||
// 임시로 돌 놓기
|
||||
board[row, col] = Black;
|
||||
|
||||
// 장목 검사
|
||||
bool isOverline = CheckOverline(board, row, col);
|
||||
|
||||
|
||||
board[row, col] = Space;
|
||||
|
||||
return isOverline;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 장목(6목 이상) 여부를 검사합니다.
|
||||
/// </summary>
|
||||
private bool CheckOverline(Enums.PlayerType[,] board, int row, int col)
|
||||
{
|
||||
// 4개의 방향 쌍에 대해 검사
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int dir1 = DirectionPairs[i, 0];
|
||||
int dir2 = DirectionPairs[i, 1];
|
||||
|
||||
// 해당 방향 쌍에서 연속된 돌의 총 개수 계산
|
||||
int count = CountConsecutiveStones(board, row, col, dir1, dir2);
|
||||
|
||||
// 6목 이상이면 장목
|
||||
if (count >= 6)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 특정 방향 쌍에서 연속된 돌의 개수를 계산합니다.
|
||||
/// </summary>
|
||||
/// <param name="board">현재 보드 상태</param>
|
||||
/// <param name="row">시작 행</param>
|
||||
/// <param name="col">시작 열</param>
|
||||
/// <param name="dir1">첫 번째 방향 인덱스</param>
|
||||
/// <param name="dir2">두 번째(반대) 방향 인덱스</param>
|
||||
/// <returns>연속된 돌의 총 개수</returns>
|
||||
private int CountConsecutiveStones(Enums.PlayerType[,] board, int row, int col, int dir1, int dir2)
|
||||
{
|
||||
int count = 1; // 현재 위치의 돌 포함
|
||||
|
||||
// 첫 번째 방향으로 연속된 돌 확인
|
||||
count += CountInDirection(board, row, col, dir1);
|
||||
|
||||
// 두 번째(반대) 방향으로 연속된 돌 확인
|
||||
count += CountInDirection(board, row, col, dir2);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 특정 방향으로의 연속된 돌 개수를 계산합니다.
|
||||
/// </summary>
|
||||
/// <param name="board">현재 보드 상태</param>
|
||||
/// <param name="startRow">시작 행</param>
|
||||
/// <param name="startCol">시작 열</param>
|
||||
/// <param name="dirIndex">방향 인덱스</param>
|
||||
/// <returns>해당 방향의 연속된 돌 개수</returns>
|
||||
private int CountInDirection(Enums.PlayerType[,] board, int startRow, int startCol, int dirIndex)
|
||||
{
|
||||
int count = 0;
|
||||
int dRow = Directions[dirIndex, 0];
|
||||
int dCol = Directions[dirIndex, 1];
|
||||
|
||||
for (int i = 1; i < BoardSize; i++)
|
||||
{
|
||||
int newRow = startRow + dRow * i;
|
||||
int newCol = startCol + dCol * i;
|
||||
|
||||
if (IsInBounds(newRow, newCol) && board[newRow, newCol] == Black)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
3
Assets/Script/Renju/RenjuOverlineDetector.cs.meta
Normal file
3
Assets/Script/Renju/RenjuOverlineDetector.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbb7c61178964d4b8aeb7fb8375bf285
|
||||
timeCreated: 1742265525
|
51
Assets/Script/Renju/RenjuRuleChecker.cs
Normal file
51
Assets/Script/Renju/RenjuRuleChecker.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 렌주 규칙의 모든 금수 규칙(3-3, 4-4, 장목)을 검사하는 통합 클래스
|
||||
/// </summary>
|
||||
public class RenjuRuleChecker: ForbiddenDetectorBase
|
||||
{
|
||||
private RenjuOverlineDetector _overlineDetactor = new();
|
||||
private RenjuDoubleFourDetector _doubleFourDetactor = new();
|
||||
private RenjuDoubleThreeDetector _doubleThreeDetector = new();
|
||||
|
||||
public List<Vector2Int> GetForbiddenMoves(Enums.PlayerType[,] board)
|
||||
{
|
||||
List<Vector2Int> forbiddenMoves = new();
|
||||
for (int row = 0; row < BoardSize; row++)
|
||||
{
|
||||
for (int col = 0; col < BoardSize; col++)
|
||||
{
|
||||
// ** 비어 있지 않으면 검사할 필요 없음 **
|
||||
if (!IsEmptyPosition(board, row, col)) continue;
|
||||
|
||||
// 장목 검사
|
||||
if (_overlineDetactor.IsOverline(board, row, col))
|
||||
{
|
||||
Debug.Log("장목 금수 좌표 X축 : " + row + ", Y축 : " + col);
|
||||
forbiddenMoves.Add(new Vector2Int(row, col));
|
||||
continue;
|
||||
}
|
||||
|
||||
// 4-4 검사
|
||||
if (_doubleFourDetactor.IsDoubleFour(board, row, col))
|
||||
{
|
||||
Debug.Log("사사 금수 좌표 X축 : " + row + ", Y축 : " + col);
|
||||
forbiddenMoves.Add(new Vector2Int(row, col));
|
||||
continue;
|
||||
}
|
||||
|
||||
// 3-3 검사
|
||||
if (_doubleThreeDetector.IsDoubleThree(board, row, col))
|
||||
{
|
||||
Debug.Log("삼삼 금수 좌표 X축 : " + row + ", Y축 : " + col);
|
||||
forbiddenMoves.Add(new Vector2Int(row, col));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return forbiddenMoves;
|
||||
}
|
||||
}
|
||||
|
3
Assets/Script/Renju/RenjuRuleChecker.cs.meta
Normal file
3
Assets/Script/Renju/RenjuRuleChecker.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 083e8b9070ed407b8744d4cacd0d53dc
|
||||
timeCreated: 1742256498
|
54610
Assets/Trash Can_JY/Renju.unity
Normal file
54610
Assets/Trash Can_JY/Renju.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Trash Can_JY/Renju.unity.meta
Normal file
7
Assets/Trash Can_JY/Renju.unity.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 78e1dad1deba3d447a2a5a67c80cc42e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
x
Reference in New Issue
Block a user