예제 #1
0
        public void RemovePlayer(int index, bool disqualify = false)
        {
            Player player = ActiveTournament.Participants[index];
            string text   = "remove";

            if (Started)
            {
                text = "drop";
            }
            else if (Started & disqualify)
            {
                text = "disqualify";
            }
            if (ActiveIO.ShowMessageWithOKCancel("Do you really want to " + text + " " + player.DisplayName + "?"))
            {
                if (text == "remove")
                {
                    ActiveTournament.RemovePlayer(player);
                }
                else if (text == "drop")
                {
                    ActiveTournament.DropPlayer(player);
                }
                else if (text == "disqualify")
                {
                    ActiveTournament.DisqualifyPlayer(player);
                }
            }
        }
예제 #2
0
        public void Load(IAutoSaveDialog iad, bool autosave)
        {
            bool   overwrite = true;
            string filename  = "";

            if (autosave)
            {
                string[]            filenames = ActiveIO.GetAutosaveFiles();
                List <AutosaveFile> files     = new List <AutosaveFile>();
                for (int i = filenames.Length - 1; i >= 0; i--)
                {
                    files.Add(new AutosaveFile(filenames[i]));
                }
                iad.Init(files);
                iad.ShowDialog();
                overwrite = iad.GetDialogReturn();
                filename  = iad.GetFileName();
            }
            else
            {
                if (ActiveTournament != null)
                {
                    if (!ActiveIO.ShowMessageWithOKCancel("The current tournament will be overwritten."))
                    {
                        overwrite = false;
                    }
                }
            }
            if (overwrite == true)
            {
                ActiveTournament = ActiveIO.Load(filename);
            }
        }
예제 #3
0
 public void NewTournament(ITournamentDialog itd)
 {
     if (ActiveTournament != null)
     {
         if (!ActiveIO.ShowMessageWithOKCancel("The current tournament will be overwritten."))
         {
             return;
         }
     }
     itd.SetIO(ActiveIO);
     itd.ShowDialog();
     if (itd.GetDialogResult())
     {
         ActiveTournament        = itd.GetTournament();
         ActiveTimer.DefaultTime = ActiveTournament.Rule.DefaultTime;
     }
 }