Beispiel #1
0
        /// <summary>
        /// Removes the participant.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="participant">The participant.</param>
        private void RemoveParticipant <T>(T participant)
        {
            if (participant != null)
            {
                if (participant is Player)
                {
                    var player = participant as Player;

                    if (Players != null && Players.Contains(player))
                    {
                        Players.Remove(player);
                    }
                }
                else if (participant is Referee)
                {
                    var referee = participant as Referee;

                    if (Referees != null && Referees.Contains(referee))
                    {
                        Referees.Remove(referee);
                    }
                }
                else if (participant is GameMaster)
                {
                    GameMaster = null;
                }
            }
        }
Beispiel #2
0
 // This method will add a Game Master if one doesn't excist, or replace the existing one.
 public void AddGameMaster(Referee referee)
 {
     if (Referees.Contains(referee))
     {
         GameMaster = referee;
     }
     else
     {
         Console.WriteLine("This referee does not excist in the tournament, and can therefore not be set as Game Master");
     }
 }