Class Level

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

public abstract class Level extends Object implements Iterable<LevelObject>, Cloneable
Represents a LevelZ level.
  • Constructor Details

    • Level

      protected Level()
      Creates an empty Level.
    • Level

      protected Level(@NotNull @NotNull Map<String,String> headers)
      Creates a new Level with the given headers.
      Parameters:
      headers - Level Headers
  • Method Details

    • getSpawn

      @NotNull public abstract @NotNull Coordinate getSpawn()
      Gets the spawn point for this level.
      Returns:
      Level Spawn
    • getCoordinates

      @NotNull public abstract @NotNull @Unmodifiable Set<Coordinate> getCoordinates()
      Gets an immutable copy of all coordinates in this level.
      Returns:
      Level Coordinates
    • getBlocks

      @NotNull public abstract @NotNull @Unmodifiable Set<LevelObject> getBlocks()
      Gets an immutable copy of all blocks to their coordinates in this level.
      Returns:
      Level Blocks
    • getHeaders

      @NotNull public final @NotNull @Unmodifiable Map<String,String> getHeaders()
      Gets an immutable copy of the raw headers for this level.
      Returns:
      Level Headers
    • clone

      public Level clone()
      Overrides:
      clone in class Object
    • iterator

      public final Iterator<LevelObject> iterator()
      Specified by:
      iterator in interface Iterable<LevelObject>