Class LevelObject

java.lang.Object
xyz.calcugames.levelz.LevelObject
All Implemented Interfaces:
Comparable<LevelObject>

public final class LevelObject extends Object implements Comparable<LevelObject>
Utility Object for representing a Level Block and its Coordinate.
  • Constructor Details

    • LevelObject

      public LevelObject(@NotNull @NotNull Block block, @NotNull @NotNull Coordinate coordinate)
      Creates a new LevelObject with the given block and coordinate.
      Parameters:
      block - Block
      coordinate - Coordinate
    • LevelObject

      public LevelObject(@NotNull @NotNull Block block, int x, int y)
      Creates a new LevelObject with the given block and coordinate.
      Parameters:
      block - Block
      x - X Coordinate
      y - Y Coordinate
    • LevelObject

      public LevelObject(@NotNull @NotNull String name, int x, int y)
      Creates a new LevelObject with the given block and coordinate.
      Parameters:
      name - Block Name
      x - X Coordinate
      y - Y Coordinate
    • LevelObject

      public LevelObject(@NotNull @NotNull String name, Map<String,Object> properties, int x, int y)
      Creates a new LevelObject with the given block and coordinate.
      Parameters:
      name - Block Name
      properties - Block Properties
      x - X Coordinate
      y - Y Coordinate
    • LevelObject

      public LevelObject(@NotNull @NotNull Block block, int x, int y, int z)
      Creates a new LevelObject with the given block and coordinate.
      Parameters:
      block - Block
      x - X Coordinate
      y - Y Coordinate
      z - Z Coordinate
    • LevelObject

      public LevelObject(@NotNull @NotNull String name, int x, int y, int z)
      Creates a new LevelObject with the given block and coordinate.
      Parameters:
      name - Block Name
      x - X Coordinate
      y - Y Coordinate
      z - Z Coordinate
    • LevelObject

      public LevelObject(@NotNull @NotNull String name, Map<String,Object> properties, int x, int y, int z)
      Creates a new LevelObject with the given block and coordinate.
      Parameters:
      name - Block Name
      properties - Block Properties
      x - X Coordinate
      y - Y Coordinate
      z - Z Coordinate
  • Method Details

    • getBlock

      @NotNull public @NotNull Block getBlock()
      Gets the block of this LevelObject.
      Returns:
      LevelObject Block
    • getCoordinate

      @NotNull public @NotNull Coordinate getCoordinate()
      Gets the coordinate of this LevelObject.
      Returns:
      LevelObject Coordinate
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(LevelObject o)
      Specified by:
      compareTo in interface Comparable<LevelObject>