Example #1
0
 /**
  * Prepare the flash message to be renderized.
  *
  * @param ModelFlashMessage $form
  */
 public function prepare(ModelFlashMessage $message)
 {
     $this->output = $message->getMessage();
     if (!empty($this->output)) {
         $this->output = "*** {$this->output} ***";
     }
 }
Example #2
0
 /**
  * Process the consequences of hit a ship
  *
  * @param integer $yPosition
  * @param integer $xPosition
  */
 protected function hitAShipt($yPosition, $xPosition)
 {
     $this->battlefield->markPositionAsHit($yPosition, $xPosition);
     if (true === $this->battlefield->isShipSunk()) {
         $this->flashMessage->notifySunk();
     } else {
         $this->flashMessage->notifyHit();
     }
 }