예제 #1
0
        static void nMain(string[] args)
        {
            var url = "http://localhost/BlackJackApi/";

            lobbyClient = new LobbyApi(url);

            var games = lobbyClient.ApiLobbyListGet();

            var gameId = lobbyClient.ApiLobbyNewgameNameMinbetMaxbetPost("HelloTomx", 10, 100).Replace("\"", "");

            gameClient = new GameApi(url);
            Player1    = gameClient.GameIdJoinPut(gameId, "John Snow", Position1);
            Player2    = gameClient.GameIdJoinPut(gameId, "Stephen Fry", Position2);
            PlayRound(gameId);
            return;
        }
예제 #2
0
        private void mnuCreateJoin_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                // create a game and join it
                _gameId = _lobbyClient.ApiLobbyNewgameNameMinbetMaxbetPost($"ADDBG{DateTime.Now.ToString("yyyyMMddHHmm")}", 10, 100).Replace("\"", "");
                var model = _gameClient.GameIdJoinPut(_gameId, "Debugger", 1);
                _playerId = model.Id;

                // Bet on our first hand
                _gameClient.GameIdPlayerPlayerIdBetAmountPost(_gameId, _playerId, 10);

                // get the cards
                var game = _gameClient.GameIdDetailsGet(_gameId);
                DrawGame(game);
                SetRoundBusyButtons();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }