Esempio n. 1
0
 public bool RemoveSpectatingPlayer(Spectator spectator)
 {
     foreach (Spectator spec in spectators)
     {
         if (spec.Id == spectator.Id)
         {
             spectators.Remove(spec);
             return(true);
         }
     }
     return(false);
 }
Esempio n. 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);
        }
Esempio n. 3
0
 public bool RemoveSpectatingPlayer(Spectator spectator)
 {
     return(MyGame.RemoveSpectatingPlayer(spectator));
 }