Example #1
0
 /**
  * This method process the coordinates given to make a ship shot.
  *
  * @param string $coord
  */
 protected function manageShot(array $coord)
 {
     $this->shots++;
     if (true === $this->battlefield->hitPosition($coord['yPos'], $coord['xPos'])) {
         $this->hitAShipt($coord['yPos'], $coord['xPos']);
     } else {
         $this->battlefield->markPositionAsMiss($coord['yPos'], $coord['xPos']);
         $this->flashMessage->notifyMiss();
     }
 }