pos->getWorld()->getTile($this->pos); if($tile instanceof TileNote){ $this->pitch = $tile->getPitch(); }else{ $this->pitch = self::MIN_PITCH; } } public function writeStateToWorld() : void{ parent::writeStateToWorld(); $tile = $this->pos->getWorld()->getTile($this->pos); assert($tile instanceof TileNote); $tile->setPitch($this->pitch); } public function getFuelTime() : int{ return 300; } /** * @return int */ public function getPitch() : int{ return $this->pitch; } /** * @param int $pitch */ public function setPitch(int $pitch) : void{ if($pitch < self::MIN_PITCH or $pitch > self::MAX_PITCH){ throw new \InvalidArgumentException("Pitch must be in range " . self::MIN_PITCH . " - " . self::MAX_PITCH); } $this->pitch = $pitch; } //TODO }