thepixeldeveloper / nolimits2packageloader
nl2pkg 文件解析器
1.1.0
2015-12-25 19:01 UTC
Requires (Dev)
- phpspec/phpspec: ^2.4
This package is not auto-updated.
Last update: 2024-09-14 17:32:13 UTC
README
当提供由 No Limits Coaster 2 生成的 nlpkg 文件时,此库将返回有关公园和过山车的信息。
基本用法
你知道吗? nlpkg 文件与 ZIP 文件相同
// First load the package using ZipArchive $zip = new \ZipArchive; $zip->open('raptor.nl2pkg'); // Then give it to the package class to parse into useful information. $package = new Thepixeldeveloper\Nolimits2PackageLoader\Package($zip); /** * Examples of reading the preview image and park file */ $previewImage = $package->getPreviewImageStream(); $parkFile = $package->getParkFileStream(); /** * Instance of Thepixeldeveloper\Nolimits2PackageLoader\Park * * Contains information like the author and description. */ $parkInformation = $package->getParkInformation(); /** * Instance of Thepixeldeveloper\Nolimits2PackageLoader\Coasters * * Gives you an iterator which returns Coaster objects */ $coasters = $package->getCoasters(); /** * Instance of Thepixeldeveloper\Nolimits2PackageLoader\Coaster */ $coaster = $coasters->current(); $coaster->getStyle(); // Mack Launch $coaster->getName(); // Raptor $coaster->getNumberOfTrains(); // 1