Beispiel #1
0
 public bool RemoveSpectatingPlayer(Spectator spectator)
 {
     foreach (Spectator spec in spectators)
     {
         if (spec.Id == spectator.Id)
         {
             spectators.Remove(spec);
             return(true);
         }
     }
     return(false);
 }
Beispiel #2
0
        public Spectator AddSpectatingPlayer(User user)
        {
            if (!Pref.SpectateGame)
            {
                throw new DomainException("game not spectatable");
            }
            if (IsSpectatorExist(user.Username))
            {
                throw new DomainException("the user " + user + " is already watching this game");
            }
            Spectator spec = new Spectator(user.Username);

            spectators.Add(spec);
            return(spec);
        }
Beispiel #3
0
 public bool RemoveSpectatingPlayer(Spectator spectator)
 {
     return(MyGame.RemoveSpectatingPlayer(spectator));
 }