New SidebarMenuManager Version

This commit is contained in:
Jocy
2017-05-19 18:36:41 +02:00
parent 6193787ee5
commit e3a365f187
8 changed files with 228 additions and 179 deletions

View File

@ -564,12 +564,23 @@ class PlayerManager implements CallbackListener, TimerListener, CommunicationLis
}
/**
* Get all Players
* Get all Players with or without spectators
*
* @api
* @return Player[]
* @param bool $withoutSpectators
* @return \ManiaControl\Players\Player[]
*/
public function getPlayers() {
public function getPlayers($withoutSpectators = false) {
if($withoutSpectators){
$players = array();
foreach($this->players as $player){
if(!$player->isSpectator){
$players[] = $players;
}
}
return $players;
}
return $this->players;
}