示例#1
0
 public function castRoles()
 {
     $roles = Ginq::from($this->shuffleRoles())->take($this->room->getPlayers()->count())->toList();
     $pairs = array_map(null, $roles, $this->room->getPlayers()->getValues());
     foreach ($pairs as list($role, $player)) {
         $gamePlayer = new GamePlayer($this, $player);
         $gamePlayer->setRole($role);
     }
 }
示例#2
0
 /**
  * @JMS\VirtualProperty
  * @JMS\SerializedName("swapDestination")
  * @JMS\Groups({"finished"})
  *
  * @return array
  */
 public function getSwapDestinationsSummary()
 {
     return is_null($this->swapDestination) ? null : $this->swapDestination->getPlayer();
 }