/// <summary>
 /// Assign a player to a team.
 /// </summary>
 /// <param name="plr"></param>
 /// <param name="newTeam"></param>
 public virtual bool PlayerTeamAssign(Player plr, Team newTeam)
 {
     if (plr.Team != newTeam)
     {
         plr.Team = newTeam;
         PlayerTeamAssignEvent ev = new PlayerTeamAssignEvent(plr, newTeam);
         AppendEvent(ev);
         if (OnPlayerTeamAssign != null)
         {
             OnPlayerTeamAssign(this, ev);
         }
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
 /// <summary>
 /// Assign a player to a team.
 /// </summary>
 /// <param name="plr"></param>
 /// <param name="newTeam"></param>
 public virtual bool PlayerTeamAssign(Player plr, Team newTeam)
 {
     if (plr.Team != newTeam)
     {
         plr.Team = newTeam;
         PlayerTeamAssignEvent ev = new PlayerTeamAssignEvent(plr, newTeam);
         AppendEvent(ev);
         if (OnPlayerTeamAssign != null)
         {
             OnPlayerTeamAssign(this, ev);
         }
         return true;
     }
     return false;
 }