コード例 #1
0
    public void UpdateGameState()
    {
        GameTrace  gameTrace = GetCurrentStep();
        Vector2Int boardPos  = new Vector2Int(gameTrace.x, gameTrace.y);

        switch (GameState)
        {
        case GameState.BlackPlay:
            _turn++;
            if (WinChecker.CheckWin(_blackPlayTrace, boardPos))
            {
                _gameState = GameState.BlackWin;
            }
            else
            {
                _gameState = GameState.WhitePlay;
            }
            break;

        case GameState.WhitePlay:
            _turn++;
            if (WinChecker.CheckWin(_whitePlayTrace, boardPos))
            {
                _gameState = GameState.WhiteWin;
            }
            else
            {
                _gameState = GameState.BlackPlay;
            }
            break;

        case GameState.BlackWin:
            break;

        case GameState.WhiteWin:
            break;
        }
    }