Class BuildingActions
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.building.BuildingActions
Action component for interacting with a building. Building events should be initialised in create()
and when triggered should call methods within this class.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBuildingActions(Building type, int level) Constructs components with specified level -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLevel()Increments level by 1 and upgrades combat statsvoidcreate()Called upon creation.intgetLevel()getType()voidIncreases level by 1static booleanUsed for determining if an entity is a wallvoidSets wall type and texture to default (facing in no particular direction)voidSets wall type and texture to north-east facing wallvoidSets wall type and texture to south-east facing wallMethods inherited from class com.deco2800.game.components.Component
dispose, earlyUpdate, getEntity, isAnimationRenderComponent, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
BuildingActions
Constructs components with specified level- Parameters:
level- initial building level when createdtype- type of Building
-
-
Method Details
-
getLevel
public int getLevel()- Returns:
- Building level
-
getType
- Returns:
- Building type
-
addLevel
public void addLevel()Increments level by 1 and upgrades combat stats -
incrementLevel
public void incrementLevel()Increases level by 1 -
isWall
Used for determining if an entity is a wall- Parameters:
type- Building type- Returns:
- If the building is a wall -> true; else -> false
-
setWallDefault
public void setWallDefault()Sets wall type and texture to default (facing in no particular direction) -
setWallNE
public void setWallNE()Sets wall type and texture to north-east facing wall -
setWallSE
public void setWallSE()Sets wall type and texture to south-east facing wall -
create
public void create()Called upon creation. Used to define events for event listener to trigger.
-