Package xyz.calcugames.levelz
Class Level2D
java.lang.Object
xyz.calcugames.levelz.Level
xyz.calcugames.levelz.Level2D
- All Implemented Interfaces:
Cloneable,Iterable<LevelObject>
Represents a 2D level.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()@NotNull @Unmodifiable Set<LevelObject>Gets an immutable copy of all blocks to their coordinates in this level.Gets an immutable copy of all coordinates in this level.@NotNull ScrollGets the scroll direction for this 2D Level.getSpawn()Gets the spawn point for this level.Methods inherited from class xyz.calcugames.levelz.Level
getHeaders, iteratorMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Level2D
public Level2D()Creates an empty 2D Level. -
Level2D
Creates a new 2D Level with the given headers.- Parameters:
headers- Level Headers
-
Level2D
public Level2D(@NotNull @NotNull Map<String, String> headers, @NotNull @NotNull Collection<LevelObject> blocks) Creates a new 2D Level with the given headers and blocks.- Parameters:
headers- Level Headersblocks- Level Blocks
-
-
Method Details
-
getScroll
Gets the scroll direction for this 2D Level.- Returns:
- Level Scroll Direction
-
getSpawn
Description copied from class:LevelGets the spawn point for this level. -
getCoordinates
Description copied from class:LevelGets an immutable copy of all coordinates in this level.- Specified by:
getCoordinatesin classLevel- Returns:
- Level Coordinates
-
getBlocks
Description copied from class:LevelGets an immutable copy of all blocks to their coordinates in this level. -
clone
-