private void Igs_MatchRequestAccepted(object sender, IgsGame game) { InGameForm ingameForm = new FormsPrototype.InGameForm(game.Info, game.Controller, igs); ingameForm.LoadGame(game); ingameForm.Show(); }
private void Events_GameJoined(object sender, KgsGame e) { InGameForm ingameForm = new FormsPrototype.InGameForm(e.Info, e.Controller, this.kgs); ingameForm.LoadGame(e); ingameForm.Show(); }
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(); }
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."); } } }
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."); } } }