Package com.csse3200.game.services
Class WorldMapService
java.lang.Object
com.csse3200.game.services.WorldMapService
Service for managing world map nodes dynamically. Allows registration of screens/levels without
requiring a static JSON file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear all registered nodesvoid
completeNode
(String key) Mark a node as completedGet all registered nodesRetrieve a map nodevoid
Lock a specific nodevoid
registerNode
(WorldMapNode node, String key) Register a new node on the world mapvoid
registerNodeRenderComponent
(WorldMapNodeRenderComponent renderComponent) Register a node render component for proximity updatesvoid
unlockNode
(String key) Unlock a specific nodevoid
updateNodeProximity
(WorldMapNode nearbyNode) Update all node render components with the current nearby node
-
Constructor Details
-
WorldMapService
public WorldMapService()Constructor for the world map service.
-
-
Method Details
-
registerNode
Register a new node on the world map- Parameters:
node
- The node to registerkey
- The key to register the node with
-
getNode
Retrieve a map node- Parameters:
key
- The key to get the node with- Returns:
- The node, or null if not found
-
getAllNodes
Get all registered nodes- Returns:
- List of all nodes
-
completeNode
Mark a node as completed- Parameters:
key
- The key of the completed node
-
unlockNode
Unlock a specific node- Parameters:
key
- The key of the node to unlock
-
lockNode
Lock a specific node- Parameters:
key
- The key of the node to locklockReason
- The reason the node is locked
-
registerNodeRenderComponent
Register a node render component for proximity updates- Parameters:
renderComponent
- the render component to register
-
updateNodeProximity
Update all node render components with the current nearby node- Parameters:
nearbyNode
- the node that the player is currently near, or null if none
-
clearNodes
public void clearNodes()Clear all registered nodes
-