Ejemplo n.º 1
0
        public static bool LoadGameByChallengeID(int challengeID)
        {
            DataSet ds = SocketClient.AddGameData(challengeID, PlayingModeData.Instance.ChessTypeID);

            if (ds == null || ds.Tables.Count == 0)
            {
                return(false);
            }

            Ap.NewGame();
            MainOnline mainOnlineForm = new InfinityChess.WinForms.MainOnline();

            frmProgress = ProgressForm.Show(mainOnlineForm, "Loading...");

            mainOnlineForm.Game = Ap.Game;
            mainOnlineForm.Show();
            mainOnlineForm.Game.DbGame = App.Model.Db.Game.CreateGame(Ap.Cxt, ds);

            if (mainOnlineForm.Game.DbGame != null)
            {
                mainOnlineForm.NewGame();
            }

            frmProgress.Close();

            ActivateMainForm(mainOnlineForm);
            return(true);
        }
Ejemplo n.º 2
0
        private void AddGame(int challengeId)
        {
            DataSet ds = SocketClient.AddGameData(challengeId, PlayingModeData.Instance.ChessTypeID);

            base.Game.DbGame = App.Model.Db.Game.CreateGame(Ap.Cxt, ds);
        }