Level2D

class Level2D : Level

Represents a 2D level.

Constructors

Link copied to clipboard
constructor()

Creates an empty 2D Level.

constructor(headers: Map<String, String>)

Creates a new 2D Level with the given headers.

constructor(headers: Map<String, String>, blocks: Collection<LevelObject>)

Creates a new 2D Level with the given headers and blocks.

Properties

Link copied to clipboard
open override val blocks: Set<LevelObject>

The blocks in the level.

Link copied to clipboard
open override val coordinates: Set<Coordinate2D>

The coordinates in the level.

Link copied to clipboard
open override val dimension: Dimension

The dimension of the level.

Link copied to clipboard

Gets an immutable copy of the raw headers for this level, excluding the dimension.

Link copied to clipboard

The scroll direction for this 2D Level.

Link copied to clipboard
open override val spawn: Coordinate2D

The spawnpoint for the level.

Functions

Link copied to clipboard
fun Level.export(includeHeaders: Boolean = true, includeData: Boolean = true, lineSeparator: String = ""): String

Exports this Level to a String.

Link copied to clipboard

Gets an immutable copy of the raw headers for this level.

Link copied to clipboard
open operator override fun iterator(): Iterator<LevelObject>
Link copied to clipboard

Maps all the given coordinates to LevelObjects with the given block.