Inheritance: System.Entity
 public TeamRemovePlayerEvent(Team team, Player plr)
     : base(team)
 {
 }
Beispiel #2
0
 public Team(Entity parent, Team copy)
     : this(parent, copy.Name, copy.IsInternal)
 {
     members = new HashSet<Player>(copy.members);
 }
Beispiel #3
0
 /// <summary>
 /// Creates a MatchTeamRemoveEvent from within the match and returns it. Invokes any event
 /// subscriptions to OnTeamRemove.
 /// </summary>
 /// <param name="player"></param>
 /// <returns>The generated event</returns>
 /// <exception cref="InvalidEventException">Thrown when the event being created is not valid for the
 /// current state of the match.</exception>
 protected internal virtual void TeamRemove(Team team)
 {
     InvokeEvent(new MatchTeamRemoveEvent(this, team));
 }
Beispiel #4
0
 public TeamEvent(Team team)
     : base(team)
 {
     Team = team;
 }
 public TeamAddPlayerEvent(Team team, Player plr)
     : base(team)
 {
     Player = plr;
 }
        private void HandleAddPlayer(Event ev)
        {
            MatchAddPlayerEvent evCasted = (MatchAddPlayerEvent)ev;
            Player plr = evCasted.Player;
            Team plrTeam = new Team(this, String.Format("{0}'s team", plr.Name));
            TeamAdd(plrTeam);
            plrTeam.PlayerAdd(plr);

            plr.OnEvent += HandlePlayerShot;
            plr.OnEvent += HandlePlayerLose;
            foreach (Ship ship in plr.Ships)
            {
                ship.OnEvent += HandleShipMove;
                ship.OnEvent += HandleShipDestroyed;
            }
        }
 /// <summary>
 /// Constructs the event with the new team.
 /// </summary>
 /// <param name="team"></param>
 public MatchTeamAddEvent(Match match, Team team)
     : base(match)
 {
     Team = team;
 }
 /// <summary>
 /// Constructs the event with the team to be removed.
 /// </summary>
 /// <param name="team"></param>
 public MatchTeamRemoveEvent(Match match, Team team)
     : base(match)
 {
     Team = team;
 }