DO-62 [Fix] 착수 버그 수정
This commit is contained in:
parent
4dca270bc8
commit
cdf197b358
@ -12,6 +12,10 @@ public abstract class BasePlayerState
|
|||||||
public abstract void OnExit(GameLogic gameLogic);
|
public abstract void OnExit(GameLogic gameLogic);
|
||||||
public abstract void HandleMove(GameLogic gameLogic, int row, int col);
|
public abstract void HandleMove(GameLogic gameLogic, int row, int col);
|
||||||
public abstract void HandleNextTurn(GameLogic gameLogic);
|
public abstract void HandleNextTurn(GameLogic gameLogic);
|
||||||
|
|
||||||
|
protected string _roomId;
|
||||||
|
protected bool _isMultiplay;
|
||||||
|
protected MultiplayManager _multiplayManager;
|
||||||
|
|
||||||
public void ProcessMove(GameLogic gameLogic, Enums.PlayerType playerType, int row, int col)
|
public void ProcessMove(GameLogic gameLogic, Enums.PlayerType playerType, int row, int col)
|
||||||
{
|
{
|
||||||
@ -20,6 +24,12 @@ public abstract class BasePlayerState
|
|||||||
gameLogic.SetNewBoardValue(playerType, row, col);
|
gameLogic.SetNewBoardValue(playerType, row, col);
|
||||||
gameLogic.CountStoneCounter();
|
gameLogic.CountStoneCounter();
|
||||||
|
|
||||||
|
if (_isMultiplay)
|
||||||
|
{
|
||||||
|
Debug.Log("row: " + row + "col: " + col);
|
||||||
|
_multiplayManager.SendPlayerMove(_roomId, new Vector2Int(row, col));
|
||||||
|
}
|
||||||
|
|
||||||
if (gameLogic.CheckGameWin(playerType, row, col))
|
if (gameLogic.CheckGameWin(playerType, row, col))
|
||||||
{
|
{
|
||||||
var gameResult = playerType == Enums.PlayerType.PlayerA? Enums.GameResult.Win:Enums.GameResult.Lose;
|
var gameResult = playerType == Enums.PlayerType.PlayerA? Enums.GameResult.Win:Enums.GameResult.Lose;
|
||||||
@ -53,10 +63,6 @@ public class PlayerState : BasePlayerState
|
|||||||
private Enums.PlayerType _playerType;
|
private Enums.PlayerType _playerType;
|
||||||
private bool _isFirstPlayer;
|
private bool _isFirstPlayer;
|
||||||
|
|
||||||
private MultiplayManager _multiplayManager;
|
|
||||||
private string _roomId;
|
|
||||||
private bool _isMultiplay;
|
|
||||||
|
|
||||||
public PlayerState(bool isFirstPlayer)
|
public PlayerState(bool isFirstPlayer)
|
||||||
{
|
{
|
||||||
_isFirstPlayer = isFirstPlayer;
|
_isFirstPlayer = isFirstPlayer;
|
||||||
@ -108,11 +114,6 @@ public class PlayerState : BasePlayerState
|
|||||||
public override void HandleMove(GameLogic gameLogic, int row, int col)
|
public override void HandleMove(GameLogic gameLogic, int row, int col)
|
||||||
{
|
{
|
||||||
gameLogic.SetStoneSelectedState(row, col);
|
gameLogic.SetStoneSelectedState(row, col);
|
||||||
if (_isMultiplay)
|
|
||||||
{
|
|
||||||
Debug.Log("row: " + row + "col: " + col);
|
|
||||||
_multiplayManager.SendPlayerMove(_roomId, new Vector2Int(row, col));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void HandleNextTurn(GameLogic gameLogic)
|
public override void HandleNextTurn(GameLogic gameLogic)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user