Esempio n. 1
0
        private async void cmdOK_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtName.Text))
            {
                MessageBox.Show("Please enter your name");
                txtName.Focus();
                return;
            }

            var url = "https://connect4core.azurewebsites.net/";
            //var url = "https://localhost:5001/";
            var api      = new API(new Uri(url));
            var playerID = await api.RegisterTeam(txtName.Text, "23456236478236");

            var details = new APIDetails
            {
                PlayerID = playerID,
                Password = "******",
            };

            await api.NewGame(playerID);

            var frm = new Form1(details, api);

            this.Hide();
            frm.Show();
        }
Esempio n. 2
0
 public Form1(APIDetails details, API api)
 {
     InitializeComponent();
     _details = details;
     _api     = api;
 }