| @@ 13-86 (lines=74) @@ | ||
| 10 | /** |
|
| 11 | * Event announced when someone a player is kicked from a conversation |
|
| 12 | */ |
|
| 13 | class ConversationKickEvent extends Event |
|
| 14 | { |
|
| 15 | /** |
|
| 16 | * @var \Conversation |
|
| 17 | */ |
|
| 18 | protected $conversation; |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @var \Player|\Team |
|
| 22 | */ |
|
| 23 | protected $kicked; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @var \Player |
|
| 27 | */ |
|
| 28 | protected $kicker; |
|
| 29 | ||
| 30 | /** |
|
| 31 | * Create a new event |
|
| 32 | * |
|
| 33 | * @param \Conversation $conversation The conversation from which the player was kicked |
|
| 34 | * @param \Player|\Team $kicked The member who was kicked |
|
| 35 | * @param \Player $kicker The player who issued the kick |
|
| 36 | */ |
|
| 37 | public function __construct(\Conversation $conversation, \Model $kicked, \Player $kicker) |
|
| 38 | { |
|
| 39 | $this->conversation = $conversation; |
|
| 40 | $this->kicked = $kicked; |
|
| 41 | $this->kicker = $kicker; |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * Get the conversation from which the player was kicked |
|
| 46 | * |
|
| 47 | * @return \Conversation |
|
| 48 | */ |
|
| 49 | public function getConversation() |
|
| 50 | { |
|
| 51 | return $this->conversation; |
|
| 52 | } |
|
| 53 | ||
| 54 | /** |
|
| 55 | * Get the member who was kicked |
|
| 56 | * |
|
| 57 | * @return \Player|\Team |
|
| 58 | */ |
|
| 59 | public function getKicked() |
|
| 60 | { |
|
| 61 | return $this->kicked; |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * Get the member who was kicked |
|
| 66 | * |
|
| 67 | * Alias for ConversationKickEvent::getKicked() |
|
| 68 | * |
|
| 69 | * @return \Player|\Team |
|
| 70 | */ |
|
| 71 | public function getMember() |
|
| 72 | { |
|
| 73 | return $this->kicked; |
|
| 74 | } |
|
| 75 | ||
| 76 | ||
| 77 | /** |
|
| 78 | * Get the player who issued the kick |
|
| 79 | * |
|
| 80 | * @return \Player |
|
| 81 | */ |
|
| 82 | public function getKicker() |
|
| 83 | { |
|
| 84 | return $this->kicker; |
|
| 85 | } |
|
| 86 | } |
|
| 87 | ||
| @@ 13-90 (lines=78) @@ | ||
| 10 | /** |
|
| 11 | * Event thrown when a conversation gets renamed |
|
| 12 | */ |
|
| 13 | class ConversationRenameEvent extends Event |
|
| 14 | { |
|
| 15 | /** |
|
| 16 | * @var \Conversation |
|
| 17 | */ |
|
| 18 | protected $conversation; |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @var string |
|
| 22 | */ |
|
| 23 | protected $oldSubject; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @var string |
|
| 27 | */ |
|
| 28 | protected $newSubject; |
|
| 29 | ||
| 30 | /** |
|
| 31 | * @var \Player |
|
| 32 | */ |
|
| 33 | protected $player; |
|
| 34 | ||
| 35 | /** |
|
| 36 | * Create a new event |
|
| 37 | * |
|
| 38 | * @param \Conversation $conversation The conversation in question |
|
| 39 | * @param string $oldSubject The old name of the Conversation |
|
| 40 | * @param string $newSubject The new name of the conversation |
|
| 41 | * @param \Player $player The player who made the change |
|
| 42 | */ |
|
| 43 | public function __construct(\Conversation $conversation, $oldSubject, $newSubject, \Player $player) |
|
| 44 | { |
|
| 45 | $this->conversation = $conversation; |
|
| 46 | $this->oldSubject = $oldSubject; |
|
| 47 | $this->newSubject = $newSubject; |
|
| 48 | $this->player = $player; |
|
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * Get the conversation that was renamed |
|
| 53 | * |
|
| 54 | * @return \Conversation |
|
| 55 | */ |
|
| 56 | public function getConversation() |
|
| 57 | { |
|
| 58 | return $this->conversation; |
|
| 59 | } |
|
| 60 | ||
| 61 | /** |
|
| 62 | * Get the Player who renamed the conversation |
|
| 63 | * |
|
| 64 | * @return \Player |
|
| 65 | */ |
|
| 66 | public function getPlayer() |
|
| 67 | { |
|
| 68 | return $this->player; |
|
| 69 | } |
|
| 70 | ||
| 71 | /** |
|
| 72 | * Get the old name of the conversation |
|
| 73 | * |
|
| 74 | * @return string |
|
| 75 | */ |
|
| 76 | public function getOldSubject() |
|
| 77 | { |
|
| 78 | return $this->oldSubject; |
|
| 79 | } |
|
| 80 | ||
| 81 | /** |
|
| 82 | * Get the new name of the conversation |
|
| 83 | * |
|
| 84 | * @return string |
|
| 85 | */ |
|
| 86 | public function getNewSubject() |
|
| 87 | { |
|
| 88 | return $this->newSubject; |
|
| 89 | } |
|
| 90 | } |
|
| 91 | ||
| @@ 13-93 (lines=81) @@ | ||
| 10 | /** |
|
| 11 | * Event announced when someone a player is kicked from a team |
|
| 12 | */ |
|
| 13 | class TeamKickEvent extends Event |
|
| 14 | { |
|
| 15 | /** |
|
| 16 | * @var \Team |
|
| 17 | */ |
|
| 18 | protected $team; |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @var \Player |
|
| 22 | */ |
|
| 23 | protected $kicked; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @var \Player |
|
| 27 | */ |
|
| 28 | protected $kicker; |
|
| 29 | ||
| 30 | /** |
|
| 31 | * Create a new event |
|
| 32 | * |
|
| 33 | * @param \Team $team The team from which the player was kicked |
|
| 34 | * @param \Player $kicked The player who was kicked |
|
| 35 | * @param \Player $kicker The player who issued the kick |
|
| 36 | */ |
|
| 37 | public function __construct(\Team $team, \Player $kicked, \Player $kicker) |
|
| 38 | { |
|
| 39 | $this->team = $team; |
|
| 40 | $this->kicked = $kicked; |
|
| 41 | $this->kicker = $kicker; |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * Get the team from which the player was kicked |
|
| 46 | * |
|
| 47 | * @return \Team |
|
| 48 | */ |
|
| 49 | public function getTeam() |
|
| 50 | { |
|
| 51 | return $this->team; |
|
| 52 | } |
|
| 53 | ||
| 54 | /** |
|
| 55 | * Get the player who was kicked |
|
| 56 | * |
|
| 57 | * @return \Player |
|
| 58 | */ |
|
| 59 | public function getKicked() |
|
| 60 | { |
|
| 61 | return $this->kicked; |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * Get the player who issued the kick |
|
| 66 | * |
|
| 67 | * @return \Player |
|
| 68 | */ |
|
| 69 | public function getKicker() |
|
| 70 | { |
|
| 71 | return $this->kicker; |
|
| 72 | } |
|
| 73 | ||
| 74 | /** |
|
| 75 | * Get the player who was kicked |
|
| 76 | * |
|
| 77 | * Alias for TeamKickEvent::getKicked() |
|
| 78 | * |
|
| 79 | * @return \Player $player |
|
| 80 | */ |
|
| 81 | public function getPlayer() |
|
| 82 | { |
|
| 83 | return $this->kicked; |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * {@inheritdoc} |
|
| 88 | */ |
|
| 89 | public function notify($type) |
|
| 90 | { |
|
| 91 | $this->doNotify($this->kicked, $type); |
|
| 92 | } |
|
| 93 | } |
|
| 94 | ||