DO-33 [Refactor] GameLogic 구조 수정
This commit is contained in:
parent
b43fb6a726
commit
959c967cf1
@ -16,7 +16,7 @@ public abstract class BasePlayerState
|
||||
gameLogic.fioTimer.PauseTimer();
|
||||
|
||||
gameLogic.SetNewBoardValue(playerType, row, col);
|
||||
//TODO: 승리확인
|
||||
|
||||
if (gameLogic.CheckGameWin(playerType, row, col))
|
||||
{
|
||||
GameManager.Instance.OpenConfirmPanel($"Game Over: {playerType} Win",() =>{});
|
||||
@ -24,6 +24,7 @@ public abstract class BasePlayerState
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO: 무승부 확인
|
||||
HandleNextTurn(gameLogic);
|
||||
}
|
||||
|
||||
@ -44,6 +45,8 @@ public class PlayerState : BasePlayerState
|
||||
{
|
||||
gameLogic.fioTimer.StartTimer();
|
||||
|
||||
//TODO: 첫번째 플레이어면 렌주 룰 확인
|
||||
|
||||
gameLogic.currentTurn = _playerType;
|
||||
gameLogic.stoneController.OnStoneClickedDelegate = (row, col) =>
|
||||
{
|
||||
@ -188,9 +191,6 @@ public class GameLogic : MonoBehaviour
|
||||
//TODO: 멀티 구현 필요
|
||||
break;
|
||||
}
|
||||
|
||||
//임시 금수
|
||||
stoneController.SetStoneState(Enums.StoneState.Blocked, 3, 3);
|
||||
}
|
||||
//착수 버튼 클릭시 호출되는 함수
|
||||
public void OnConfirm()
|
||||
@ -236,25 +236,28 @@ public class GameLogic : MonoBehaviour
|
||||
{
|
||||
if (_board[row, col] != Enums.PlayerType.None) return;
|
||||
|
||||
if (playerType == Enums.PlayerType.PlayerA)
|
||||
switch (playerType)
|
||||
{
|
||||
stoneController.SetStoneType(Enums.StoneType.Black, row, col);
|
||||
stoneController.SetStoneState(Enums.StoneState.LastPositioned, row, col);
|
||||
_board[row, col] = Enums.PlayerType.PlayerA;
|
||||
LastNSelectedSetting(row, col);
|
||||
}
|
||||
if (playerType == Enums.PlayerType.PlayerB)
|
||||
{
|
||||
stoneController.SetStoneType(Enums.StoneType.White, row, col);
|
||||
stoneController.SetStoneState(Enums.StoneState.LastPositioned, row, col);
|
||||
_board[row, col] = Enums.PlayerType.PlayerB;
|
||||
LastNSelectedSetting(row, col);
|
||||
case Enums.PlayerType.PlayerA:
|
||||
stoneController.SetStoneType(Enums.StoneType.Black, row, col);
|
||||
stoneController.SetStoneState(Enums.StoneState.LastPositioned, row, col);
|
||||
_board[row, col] = Enums.PlayerType.PlayerA;
|
||||
LastNSelectedSetting(row, col);
|
||||
break;
|
||||
case Enums.PlayerType.PlayerB:
|
||||
stoneController.SetStoneType(Enums.StoneType.White, row, col);
|
||||
stoneController.SetStoneState(Enums.StoneState.LastPositioned, row, col);
|
||||
_board[row, col] = Enums.PlayerType.PlayerB;
|
||||
LastNSelectedSetting(row, col);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//돌 지우는 함수
|
||||
public void RemoveStone(int row, int col)
|
||||
{
|
||||
_board[row, col] = Enums.PlayerType.None;
|
||||
stoneController.SetStoneType(Enums.StoneType.None, row, col);
|
||||
stoneController.SetStoneState(Enums.StoneState.None, row, col);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user