Class IntermediateWallTool
java.lang.Object
com.csse3200.game.components.structures.tools.Tool
com.csse3200.game.components.structures.tools.PlacementTool
com.csse3200.game.components.structures.tools.IntermediateWallTool
A tool which allows the player to place an intermediate wall or upgrade basic walls.
-
Field Summary
Fields inherited from class com.csse3200.game.components.structures.tools.PlacementTool
snapX, snapY -
Constructor Summary
ConstructorsConstructorDescriptionIntermediateWallTool(com.badlogic.gdx.utils.ObjectMap<String, Integer> cost) Creates a new intermediate wall tool with the given cost. -
Method Summary
Modifier and TypeMethodDescriptioncreateStructure(Entity player) Creates an intermediate wall to place.booleanAttempts to place the wall at the given position.Methods inherited from class com.csse3200.game.components.structures.tools.PlacementTool
getSnapPosition, hasEnoughResources, isPositionValid
-
Constructor Details
-
IntermediateWallTool
Creates a new intermediate wall tool with the given cost.- Parameters:
cost- - the cost of an intermediate wall.
-
-
Method Details
-
interact
Attempts to place the wall at the given position. If there is an existing structure at the given position, and it is a wall, replaces it with an intermediate wall.- Overrides:
interactin classPlacementTool- Parameters:
player- - the player interacting with the tool.position- - the position to place the structure.- Returns:
- whether the intermediate wall was successfully placed.
-
createStructure
Creates an intermediate wall to place.- Specified by:
createStructurein classPlacementTool- Parameters:
player- - the player placing the structure.- Returns:
- the intermediate wall to place.
-