Package xyz.calcugames.levelz
Class Block
java.lang.Object
xyz.calcugames.levelz.Block
Represents a Block in a Level.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic @Nullable BlockfromString(@NotNull String string) Converts a string into a Block.@NotNull StringgetName()Gets the name of this block.Gets an immutable copy of the properties for this block.inthashCode()toString()@NotNull BlockCreates a new Block with the given name and these properties.@NotNull BlockwithProperties(@NotNull Map<String, Object> properties) Creates a new Block with this name and the given properties.
-
Constructor Details
-
Block
Creates a new Block with the given name and empty properties.- Parameters:
name- Block Name
-
Block
Creates a new Block with the given name and properties.- Parameters:
name- Block Nameproperties- Block Properties
-
-
Method Details
-
getName
Gets the name of this block.- Returns:
- Block Name
-
getProperties
Gets an immutable copy of the properties for this block.- Returns:
- Block Properties
-
withName
Creates a new Block with the given name and these properties.- Parameters:
name- Block Name- Returns:
- New Block
-
withProperties
Creates a new Block with this name and the given properties.- Parameters:
properties- Block Properties- Returns:
- New Block
-
equals
-
hashCode
public int hashCode() -
toString
-
fromString
Converts a string into a Block.- Parameters:
string- The string to convert.- Returns:
- The Block, or null if the string is empty.
-