Documentation

LayerDataReader

Service class for reading the encoded and/or compressed data.

This service class provides methods, to parse encoded and / or compressed layer data.

Tags
see
https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#data

Documentation

Table of Contents

$compressions  : array<string|int, mixed>
All the compression algorithms, which can be used by this reader.
$parsers  : array<string|int, mixed>
All DataParserInterface objects, which can be used by this reader.
__construct()  : mixed
LayerDataReader constructor.
readLayerData()  : array<string|int, mixed>
Method reads an encoded and / or compressed layer data.
getResponsibleCompression()  : CompressionInterface|null
getResponsibleParser()  : DataParserInterface|null

Properties

$compressions

All the compression algorithms, which can be used by this reader.

private array<string|int, mixed> $compressions = []

$parsers

All DataParserInterface objects, which can be used by this reader.

private array<string|int, mixed> $parsers = []

Methods

__construct()

LayerDataReader constructor.

public __construct(array<string|int, mixed> $parsers, array<string|int, mixed> $compressions) : mixed
Parameters
$parsers : array<string|int, mixed>

List of DataParserInterface which can be used to read the data

$compressions : array<string|int, mixed>

List of CompressionInterface which can be used to decompress the data

Return values
mixed

readLayerData()

Method reads an encoded and / or compressed layer data.

public readLayerData(LayerData $layerData) : array<string|int, mixed>

This method reads the encoded and / or compressed layer data and returns it as 2 dimensional array, where the first dimension represents the tile in the x axis and the second dimension is the tile in the y axis.

Parameters
$layerData : LayerData

The layer data which should be read

Tags
throws
RuntimeException
throws
ReaderException
Return values
array<string|int, mixed>

Search results