Ejemplo n.º 1
0
        public static bool ShowMainOnline(DataSet ds, bool isLoadLastGame)
        {
            App.Model.Db.Game dbGame = App.Model.Db.Game.CreateGame(Ap.Cxt, ds);
            if (dbGame == null)
            {
                return(false);
            }

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

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

            mainOnlineForm.Game        = Ap.Game;
            mainOnlineForm.Game.DbGame = dbGame;

            if (isLoadLastGame)
            {
                SetUserEngine(mainOnlineForm.Game);
            }

            mainOnlineForm.Show();
            mainOnlineForm.LoadGame();

            frmProgress.Close();

            ActivateMainForm(mainOnlineForm);

            return(true);
        }
Ejemplo n.º 2
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.º 3
0
        public static void ShowMainOnline(int challengeID, ChallengeStatusE status, int gameID)
        {
            Ap.NewGame();
            MainOnline mainOnlineForm = new InfinityChess.WinForms.MainOnline();

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

            mainOnlineForm.Game = Ap.Game;
            mainOnlineForm.Show();
            mainOnlineForm.LoadGame(challengeID, status, gameID);

            frmProgress.Close();

            ActivateMainForm(mainOnlineForm);
        }
Ejemplo n.º 4
0
        public static void ShowMainOnline(int gameID)
        {
            if (LoadKibitzerGame(gameID))
            {
                return;
            }

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

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

            mainOnlineForm.Game = new Game();
            mainOnlineForm.Show();
            mainOnlineForm.LoadGame(gameID);

            frmProgress.Close();

            ActivateMainForm(mainOnlineForm);
            Ap.KibitzersCount++;
        }