Slackwolf\Game\Game::getLivingPlayers PHP Method

getLivingPlayers() public method

An array containing all users that are still alive.
public getLivingPlayers ( ) : User[]
return Slack\User[] Users who are currently alive.
    public function getLivingPlayers()
    {
        return $this->livingPlayers;
    }

Usage Example

Ejemplo n.º 1
0
 public function fire()
 {
     $client = $this->client;
     if (!$this->gameManager->hasGame($this->channel)) {
         $client->getChannelGroupOrDMByID($this->channel)->then(function (ChannelInterface $channel) use($client) {
             $client->send(":warning: Aucun jeu en cours", $channel);
         });
         return;
     }
     // build list of players
     $playersList = PlayerListFormatter::format($this->game->getLivingPlayers());
     $this->gameManager->sendMessageToChannel($this->game, ":ok: Joueurs encore vivants : " . $playersList);
 }
All Usage Examples Of Slackwolf\Game\Game::getLivingPlayers