getWitchHealedUserId() public méthode

public getWitchHealedUserId ( ) : mixed
Résultat mixed
 /**
  * @param Game $game
  */
 private function onNightEnd(Game $game)
 {
     $votes = $game->getVotes();
     $numKilled = 0;
     $hasGuarded = false;
     $hasHealed = false;
     $hasKilled = false;
     $hunterKilled = false;
     $hunterName = "";
     $killMsg = ":skull_and_crossbones: ";
     foreach ($votes as $lynch_id => $voters) {
         $player = $game->getPlayerById($lynch_id);
         if ($lynch_id == $game->getGuardedUserId()) {
             $hasGuarded = true;
         } elseif ($lynch_id == $game->getWitchHealedUserId()) {
             $hasHealed = true;
         } else {
             $killMsg .= " @{$player->getUsername()} ({$player->role->getName()})";
             if ($player->role->isRole(Role::HUNTER)) {
                 $hunterKilled = true;
                 $hunterName = $player->getUsername();
             }
             $game->killPlayer($lynch_id);
             $hasKilled = true;
             $numKilled++;
         }
     }
     // see if witch poisoned someone
     if ($game->getWitchPoisonedUserId()) {
         $poisoned_player_id = $game->getWitchPoisonedUserId();
         $poisoned_player = $game->getPlayerById($poisoned_player_id);
         $poisoned_player_name = $poisoned_player->getUsername();
         $poisoned_player_role = (string) $poisoned_player->role->getName();
         if ($numKilled > 0) {
             $killMsg .= " and";
         }
         $killMsg .= " @{$poisoned_player->getUsername()} ({$poisoned_player_role})";
         $game->killPlayer($poisoned_player_id);
         $hasKilled = true;
         $numKilled++;
         $game->setWitchPoisonedUserId(null);
         // if killed player was hunter
         if ($poisoned_player->role->isRole(Role::HUNTER)) {
             $hunterKilled = true;
             $hunterName = $poisoned_player_name;
         }
     }
     $wasOrWere = "was";
     if ($numKilled > 1) {
         $wasOrWere = "were";
     }
     $killMsg .= " {$wasOrWere} killed during the night.";
     $game->setLastGuardedUserId($game->getGuardedUserId());
     $game->setGuardedUserId(null);
     if ($hasKilled) {
         $this->sendMessageToChannel($game, $killMsg);
         // send shoot command to hunter if in game
         if ($hunterKilled) {
             $game->setHunterNeedsToShoot(true);
             $hunterMsg = ":bow_and_arrow: " . $hunterName . " you were killed.  The night isn't over, though, because as a hunter you can take one other player with you to your grave.  Type !shoot @playername, or !shoot noone.";
             $this->sendMessageToChannel($game, $hunterMsg);
         }
     }
     if ($numKilled == 0) {
         $this->sendMessageToChannel($game, "There was no deaths in the night!");
     }
     $game->setNightEnded(true);
 }