Example #1
0
    private void RpcSetGameSituation(SerializedGameSituation serializedGameSituation)
    {
        if (!isLocalPlayer)
        {
            return;
        }
        GameSituation gameSituation = SerializedGameSituation.Deserealize(serializedGameSituation);

        clientManager.SetGameSituation(gameSituation);

        if (gameSituation.GameStatus == GameStatus.OpponentExits)
        {
            clientManager.Block(true, PlayerColor.White);
            clientManager.Block(true, PlayerColor.Black);
            return;
        }
        if ((playerColor == PlayerColor.White) && (gameSituation.IsWhiteMoving))
        {
            clientManager.Block(false, PlayerColor.White);
        }
        else if ((playerColor == PlayerColor.Black) && (!gameSituation.IsWhiteMoving))
        {
            clientManager.Block(false, PlayerColor.Black);
        }
        else
        {
            clientManager.Block(true, playerColor);
        }
    }
Example #2
0
 public void SetGameSituation(GameSituation gameSituation)
 {
     clientManager.SetGameSituation(gameSituation);
     if ((playerColor == PlayerColor.White) && (gameSituation.IsWhiteMoving))
     {
         clientManager.Block(false, PlayerColor.White);
     }
     else if ((playerColor == PlayerColor.Black) && (!gameSituation.IsWhiteMoving))
     {
         clientManager.Block(false, PlayerColor.Black);
     }
     else
     {
         clientManager.Block(true, PlayerColor.White);
         clientManager.Block(true, PlayerColor.Black);
     }
 }
Example #3
0
 public void SetGameSituation(GameSituation gameSituation)
 {
     clientManager.SetGameSituation(gameSituation);
     clientManager.Block(!gameSituation.IsWhiteMoving, PlayerColor.White);
     clientManager.Block(gameSituation.IsWhiteMoving, PlayerColor.Black);
 }