/// <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); }
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); }
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; } }