ThePixelDeveloper / Nolimits2PackageLoader

A Nolimits Coaster 2 Package File Parser

Home Page:https://nolimits-exchange.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Thepixeldeveloper\Nolimits2PackageLoader

Author Build Status HHVM Status Software License Packagist Version Total Downloads SensioLabsInsight Scrutinizer Code Quality

When given a nlpkg produced by No Limits Coaster 2 this library will return information about the park and roller coasters.

Basic Usage

Did you know? A nlpkg file is the same as a ZIP file

// 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

About

A Nolimits Coaster 2 Package File Parser

https://nolimits-exchange.com

License:MIT License


Languages

Language:PHP 100.0%