示例#1
0
 public void OnNewPlayer(Player p)
 {
     if (InvokeRequired)
     {
         Invoke(new PlayerEventHandler(OnNewPlayer), p);
         return;
     }
     BindPlayers(_server.Players);
 }
示例#2
0
        /// <summary>
        ///     Adds a new player to alliance.
        ///     Fires a new player added event.
        /// </summary>
        /// <param name="player">Player to add.</param>
        public void AddPlayer(Player player)
        {
            Players.Add(player);

            if (OnPlayerAdded != null)
            {
                OnPlayerAdded.Invoke(player);
            }
        }