added getSpectators to PlayerManager
This commit is contained in:
@ -8,6 +8,7 @@ There the following settings are existing:
|
||||
|
||||
For the description of the available implemented communcation Methods check the CommunicationMethods interface.
|
||||
|
||||
If you need methods which are not implemented, or additional Parameters, feel free to contact us.
|
||||
|
||||
Sample ManiaControl Implementation (for ManiaControl to ManiaControl connections)
|
||||
|
||||
|
@ -535,6 +535,22 @@ class PlayerManager implements CallbackListener, TimerListener, CommunicationLis
|
||||
return $this->players;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a List of Spectators
|
||||
*
|
||||
* @return Player[]
|
||||
*/
|
||||
public function getSpectators() {
|
||||
$spectators = array();
|
||||
foreach ($this->players as $player) {
|
||||
if ($player->isSpectator) {
|
||||
$spectators[] = $player;
|
||||
}
|
||||
}
|
||||
|
||||
return $spectators;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the count of all spectators
|
||||
*
|
||||
|
Reference in New Issue
Block a user