isRepresentingSpot() && !$this->isRepresentingVoid()) { throw new \Exception('The map contains invalid representations'); } parent::__construct($row, $column); $this->representation = $tileRepresentation; } /** * @return boolean */ public function isVisited() { return $this->visited; } /** * Flags this Tile as "visited" * * @return bool */ public function visit() { if ($this->isVisited()) { return false; } $this->visited = true; return true; } /** * @return boolean */ public function isRepresentingSpot() { return $this->representation == self::REPRESENTS_SPOT; } /** * @return bool */ public function isRepresentingVoid() { return $this->representation == self::REPRESENTS_VOID; } /** * @return Position */ public function getPosition() { return new Position($this->getRow(), $this->getColumn()); } }