Exemple #1
0
 private void _igs_UndoDeclined(object sender, IgsGameInfo e)
 {
     if (e == _gameInfo as IgsGameInfo)
     {
         SystemLog("An UNDO REQUEST was denied.");
     }
 }
 public IgsGameBuilder(IgsGameInfo info)
 {
     _info = info;
     this.BoardSize(info.BoardSize);
     this.CountingType(Rules.CountingType.Territory);
     this.HandicapPlacementType(Phases.HandicapPlacement.HandicapPlacementType.Fixed);
     this.Komi(info.Komi);
     this.Handicap(info.NumberOfHandicapStones);
 }
Exemple #3
0
        /// <summary>
        /// Creates IGS game controller
        /// </summary>
        /// <param name="gameInfo">Game info</param>
        /// <param name="ruleset">Ruleset</param>
        /// <param name="players">Players</param>
        /// <param name="serverConnection">Connection to IGS server</param>
        public IgsGameController(
            IgsGameInfo gameInfo,
            IRuleset ruleset,
            PlayerPair players,
            IgsConnection serverConnection) :
            base(gameInfo, ruleset, players, serverConnection)
        {
            Info = gameInfo;

            //create and register connector
            IgsConnector = new IgsConnector(this, serverConnection);
            Chat         = new ChatService(IgsConnector);
            RegisterConnector(IgsConnector);
            Server = serverConnection;
            InitializeServer(serverConnection);
        }
Exemple #4
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.");
                }
            }
        }
        private async Task ObserveGame(IgsGameInfo selectedGame)
        {
            if (selectedGame == null)
            {
                return;
            }
            ShowProgressPanel(Localizer.Igs_InitiatingObservationOfAGame);
            var onlinegame = await Connections.Igs.Commands.StartObserving(selectedGame);

            if (onlinegame == null)
            {
                // TODO (future work)  Petr: error report
            }
            else
            {
                Mvx.RegisterSingleton <IGame>(onlinegame);
                OpenInNewActiveTab <ObserverGameViewModel>();
            }
            IsWorking = false;
        }