예제 #1
0
        /// <summary>
        /// Below function is used for single challenge created when tie break occurs
        /// </summary>
        /// <param name="tournamentMatch"></param>
        /// <returns></returns>
        public static Challenge CreateChallenge(TournamentMatch tournamentMatch)
        {
            matchID = tournamentMatch.TournamentMatchID;
            Challenge Challenge = new Challenge(tournamentMatch.Cxt, 0);

            Challenge.ChallengerUserID = tournamentMatch.WhiteUserID;
            Challenge.OpponentUserID   = tournamentMatch.BlackUserID;
            Challenge.RoomID           = 7;

            Challenge.ChessTypeIDE = tournamentMatch.Tournament.ChessTypeIDE;

            Challenge.ChallengeTypeIDE      = ChallengeTypeE.Challenge;
            Challenge.ChallengeStatusIDE    = ChallengeStatusE.Accepted;
            Challenge.StatusIDE             = StatusE.Inactive;
            Challenge.ChallengeStatusIDE    = ChallengeStatusE.Seeking;
            Challenge.StatusIDE             = StatusE.Active;
            Challenge.IsRated               = tournamentMatch.Tournament.Rated;
            Challenge.WithClock             = true;
            Challenge.IsChallengerSendsGame = false;
            Challenge.GameTypeIDE           = Game.GetGameType(tournamentMatch.TimeMin, tournamentMatch.TimeSec);
            Challenge.TimeMin               = tournamentMatch.TimeMin;
            Challenge.GainPerMoveMin        = tournamentMatch.TimeSec;
            Challenge.ColorIDE              = ColorE.White;
            Challenge.TournamentMatchID     = tournamentMatch.TournamentMatchID;
            Challenge.Cxt = tournamentMatch.Cxt;

            return(Challenge);
        }
예제 #2
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);
        }
예제 #3
0
        private void LoadGame(int challengeID, ChallengeStatusE challengeStatus, int gameID)
        {
            switch (challengeStatus)
            {
            case ChallengeStatusE.None:
                GetAudienceGame(gameID);
                if (base.Game.DbGame != null)
                {
                    NewGame();
                    SetGamePrameters(base.Game.DbGame.GameXml, false);
                }
                AudienceUc.FillAudienceGrid(base.Game.Audience);
                break;

            case ChallengeStatusE.Seeking:
                AddGame(challengeID);
                if (base.Game.DbGame != null)
                {
                    NewGame();
                }
                break;

            case ChallengeStatusE.Accepted:
                GetSetGame(challengeID);
                if (base.Game.DbGame != null)
                {
                    NewGame();
                }
                break;

            case ChallengeStatusE.Withdraw:
                break;

            case ChallengeStatusE.Decline:
                break;

            default:
                break;
            }
        }