示例#1
0
        private static void Fold(ClientInfo client, JObject jsonObject)
        {
            var gameIdToken      = jsonObject["gameId"];
            var playerIndexToken = jsonObject["playerIndex"];

            if (((gameIdToken == null) || (gameIdToken.Type != JTokenType.Integer)) ||
                ((playerIndexToken == null) || (playerIndexToken.Type != JTokenType.Integer)))
            {
                throw new ArgumentException("Error: Parameters Mismatch at Fold.");
            }

            var gameId      = (int)gameIdToken;
            var playerIndex = (int)playerIndexToken;

            Console.WriteLine("Fold. parameters are: gameId: {0}, playerIndex: {1}", gameId, playerIndex);

            SendMessage(client, new { response = sl.Fold(gameId, playerIndex) });
        }