Class ExtractorTool
java.lang.Object
com.csse3200.game.components.structures.tools.Tool
com.csse3200.game.components.structures.tools.PlacementTool
com.csse3200.game.components.structures.tools.ReplacementTool
com.csse3200.game.components.structures.tools.ExtractorTool
-
Field Summary
Fields inherited from class com.csse3200.game.components.structures.tools.PlacementTool
snapX, snapY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateStructure(Entity player) Creates a new extractor producing the resource of the location it is being placed, and increments the total amount of tracked extractors of this typebooleanisPositionValid(com.badlogic.gdx.math.GridPoint2 position, PlaceableEntity structure) Checks if the position of the extractor is valid: - There is no collision with other structures (TODO or the map) - The resource type of the extractor doesnt exceed the capMethods inherited from class com.csse3200.game.components.structures.tools.ReplacementTool
hasEnoughResources, interactMethods inherited from class com.csse3200.game.components.structures.tools.PlacementTool
getSnapPosition
-
Constructor Details
-
ExtractorTool
-
-
Method Details
-
createStructure
Creates a new extractor producing the resource of the location it is being placed, and increments the total amount of tracked extractors of this type- Specified by:
createStructurein classReplacementTool- Parameters:
player- The player creating the extractor- Returns:
- the extractor, fully built
-
isPositionValid
public boolean isPositionValid(com.badlogic.gdx.math.GridPoint2 position, PlaceableEntity structure) Checks if the position of the extractor is valid: - There is no collision with other structures (TODO or the map) - The resource type of the extractor doesnt exceed the cap- Overrides:
isPositionValidin classReplacementTool- Parameters:
position- The position of the extractor- Returns:
- whether the extractor can be placed
-