Beispiel #1
0
        private void Igs_MatchRequestAccepted(object sender, IgsGame game)
        {
            InGameForm ingameForm = new FormsPrototype.InGameForm(game.Info, game.Controller, igs);

            ingameForm.LoadGame(game);
            ingameForm.Show();
        }
Beispiel #2
0
        private void Events_GameJoined(object sender, KgsGame e)
        {
            InGameForm ingameForm = new FormsPrototype.InGameForm(e.Info, e.Controller, this.kgs);
            ingameForm.LoadGame(e);
            ingameForm.Show();

        }
Beispiel #3
0
        private void bPlayLocal_Click(object sender, EventArgs e)
        {
            InGameForm ingameForm = new FormsPrototype.InGameForm(null, null, null);
            LocalGame  game       = GameBuilder.CreateLocalGame()
                                    .BlackPlayer(CreateAgentFromComboboxObject(ingameForm, this.cbBlack.SelectedItem, StoneColor.Black))
                                    .WhitePlayer(CreateAgentFromComboboxObject(ingameForm, this.cbWhite.SelectedItem, StoneColor.White))
                                    .Ruleset(RulesetType.Chinese)
                                    .Komi(7.5f)
                                    .BoardSize(new GameBoardSize((int)this.nLocalBoardSize.Value))
                                    .Build();

            ingameForm.LoadGame(game);
            ingameForm.Show();
        }
Beispiel #4
0
        private async void bAcceptRequest_Click(object sender, EventArgs e)
        {
            IgsMatchRequest selectedItem = this.lbMatchRequests.SelectedItem as IgsMatchRequest;

            if (selectedItem != null)
            {
                IgsGame game = await igs.Commands.AcceptMatchRequestAsync(selectedItem);

                if (game != null)
                {
                    InGameForm ingameForm = new FormsPrototype.InGameForm(game.Info, game.Controller, igs);
                    ingameForm.LoadGame(game);
                    ingameForm.Show();
                }
                else
                {
                    Fail("Match request cannot be accepted.");
                }
            }
        }
Beispiel #5
0
        private async void button2_Click(object sender, EventArgs e)
        {
            if (this.lbGames.SelectedItem != null)
            {
                IgsGameInfo gameInfo = (IgsGameInfo)lbGames.SelectedItem;
                var         obs      = await igs.Commands.StartObserving(gameInfo);

                if (obs != null)
                {
                    this.lbObservedGames.Items.Add(obs);
                    InGameForm ingameForm = new FormsPrototype.InGameForm(obs.Info, obs.Controller, igs);
                    ingameForm.LoadGame(obs);
                    ingameForm.Show();
                }
                else
                {
                    MessageBox.Show("Observing failed.");
                }
            }
        }