Class Level2D

java.lang.Object
xyz.calcugames.levelz.Level
xyz.calcugames.levelz.Level2D
All Implemented Interfaces:
Cloneable, Iterable<LevelObject>

public class Level2D extends Level
Represents a 2D level.
  • Constructor Details

    • Level2D

      public Level2D()
      Creates an empty 2D Level.
    • Level2D

      public Level2D(@NotNull @NotNull Map<String,String> headers)
      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 Headers
      blocks - Level Blocks
  • Method Details

    • getScroll

      @NotNull public @NotNull Scroll getScroll()
      Gets the scroll direction for this 2D Level.
      Returns:
      Level Scroll Direction
    • getSpawn

      public Coordinate2D getSpawn()
      Description copied from class: Level
      Gets the spawn point for this level.
      Specified by:
      getSpawn in class Level
      Returns:
      Level Spawn
    • getCoordinates

      public Set<Coordinate> getCoordinates()
      Description copied from class: Level
      Gets an immutable copy of all coordinates in this level.
      Specified by:
      getCoordinates in class Level
      Returns:
      Level Coordinates
    • getBlocks

      @NotNull public @NotNull @Unmodifiable Set<LevelObject> getBlocks()
      Description copied from class: Level
      Gets an immutable copy of all blocks to their coordinates in this level.
      Specified by:
      getBlocks in class Level
      Returns:
      Level Blocks
    • clone

      public Level2D clone()
      Overrides:
      clone in class Level