Package com.csse3200.game.ui
Class WorldMapNode
java.lang.Object
com.csse3200.game.ui.WorldMapNode
Represents a node on the world map that can be registered dynamically.
-
Constructor Summary
ConstructorsConstructorDescriptionWorldMapNode
(String label, net.dermetfan.utils.Pair<Float, Float> coordinates, boolean completed, boolean unlocked, GdxGame.ScreenType targetScreen, String nodeTexture, String lockReason) Creates a new world map node. -
Method Summary
Modifier and TypeMethodDescriptiongetLabel()
Gets the label of the node.Gets the lock reason of the node.Gets the texture of the node.Gets the position of the node.float
Gets the x position of the node.float
Gets the y position of the node.Gets the registration key of the node.Gets the target screen of the node.boolean
Gets the completed state of the node.boolean
Gets the unlocked state of the node.void
setCompleted
(boolean completed) Sets the completed state of the node.void
Sets the label of the node.void
setLockReason
(String reason) Sets the lock reason of the node.void
setNodeTexture
(String texture) Sets the texture of the node.void
setPosition
(float x, float y) Sets the position of the node.void
setRegistrationKey
(String registrationKey) Sets the registration key of the node.void
setTargetScreen
(GdxGame.ScreenType screenType) Sets the target screen of the node.void
setUnlocked
(boolean unlocked) Sets the unlocked state of the node.
-
Constructor Details
-
WorldMapNode
public WorldMapNode(String label, net.dermetfan.utils.Pair<Float, Float> coordinates, boolean completed, boolean unlocked, GdxGame.ScreenType targetScreen, String nodeTexture, String lockReason) Creates a new world map node.- Parameters:
label
- The label of the nodecoordinates
- The coordinates of the nodecompleted
- Whether the node is completedunlocked
- Whether the node is unlockedtargetScreen
- The target screen of the nodenodeTexture
- The texture of the nodelockReason
- The lock reason of the node
-
-
Method Details
-
setLabel
Sets the label of the node.- Parameters:
label
- The label of the node
-
getRegistrationKey
Gets the registration key of the node.- Returns:
- The registration key of the node
-
setRegistrationKey
Sets the registration key of the node.- Parameters:
registrationKey
- The registration key of the node
-
setPosition
public void setPosition(float x, float y) Sets the position of the node.- Parameters:
x
- The x coordinate of the node (0.0-1.0)y
- The y coordinate of the node (0.0-1.0)
-
setCompleted
public void setCompleted(boolean completed) Sets the completed state of the node.- Parameters:
completed
- Whether the node is completed
-
setUnlocked
public void setUnlocked(boolean unlocked) Sets the unlocked state of the node.- Parameters:
unlocked
- Whether the node is unlocked
-
setTargetScreen
Sets the target screen of the node.- Parameters:
screenType
- The target screen of the node
-
setNodeTexture
Sets the texture of the node.- Parameters:
texture
- The texture of the node
-
setLockReason
Sets the lock reason of the node.- Parameters:
reason
- The lock reason of the node
-
getLabel
Gets the label of the node.- Returns:
- The label of the node
-
getPositionX
public float getPositionX()Gets the x position of the node.- Returns:
- The xposition of the node
-
getPositionY
public float getPositionY()Gets the y position of the node.- Returns:
- The y position of the node
-
getPosition
Gets the position of the node.- Returns:
- The position of the node
-
isCompleted
public boolean isCompleted()Gets the completed state of the node.- Returns:
- The completed state of the node
-
isUnlocked
public boolean isUnlocked()Gets the unlocked state of the node.- Returns:
- The unlocked state of the node
-
getTargetScreen
Gets the target screen of the node.- Returns:
- The target screen of the node
-
getNodeTexture
Gets the texture of the node.- Returns:
- The texture of the node
-
getLockReason
Gets the lock reason of the node.- Returns:
- The lock reason of the node
-