Inheritance: System.Entity
 public TeamRemovePlayerEvent(Team team, Player plr)
     : base(team)
 {
 }
Ejemplo n.º 2
0
 public Team(Entity parent, Team copy)
     : this(parent, copy.Name, copy.IsInternal)
 {
     members = new HashSet<Player>(copy.members);
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 4
0
 public TeamEvent(Team team)
     : base(team)
 {
     Team = team;
 }
Ejemplo n.º 5
0
 public TeamAddPlayerEvent(Team team, Player plr)
     : base(team)
 {
     Player = plr;
 }
Ejemplo n.º 6
0
        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;
            }
        }
Ejemplo n.º 7
0
 /// <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;
 }