/** * * @param Box $view in pixel * @param BoxSize $section_size in pixel * @param BoxSize $tile_size in pixel */ public function __construct(TilePanel $panel, Box $view) { $this->mViewBox = $view; $this->mSectionSize = $panel->getSectionSize(); $this->mTileSize = $panel->getTileSize(); $this->buildSections(); }
/** * */ public function map() { $ss = $this->mPanel->getSectionSize(); $ts = $this->mPanel->getTileSize(); $h = ceil($this->mWorld->width * $ts->width / $ss->width); $w = ceil($this->mWorld->height * $ts->height / $ss->height); for ($y = 0; $y < $h; $y++) { for ($x = 0; $x < $w; $x++) { $this->mapSection($x, $y); } } }
/** * * @param TilePanel $panel * @return Cartographer */ public function findOneByTilePanel(TilePanel $panel) { return $this->findOneByTilePanelName($panel->getName()); }