Package model
Class Barracks
java.lang.Object
model.Entity
model.Building
model.Barracks
- All Implemented Interfaces:
Serializable
Implementation of Barracks Building type.
- See Also:
-
Field Summary
Fields inherited from class model.Building
canUpgrade, isDestroyed, isUpgraded, upgradeCost
Fields inherited from class model.Entity
animObj, damage, healthPoints, isAlive, isAnimated, maxHealthPoints, owner, position, range, side, size, type, value
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the upgrade cost of the Barrack instance.boolean
Returns if the Barrack instance is upgraded.void
setUpgraded
(boolean isUpgraded) Sets if the Barrack instance is upgraded.void
upgrade()
Upgrades the Barrack instance.Methods inherited from class model.Building
destroy, getImage, isDestroyed, setDestroyed
Methods inherited from class model.Entity
getAnimObj, getDamage, getHealthPoints, getMaxHealthPoints, getOwner, getPosition, getSide, getSize, getType, getValue, invert, isAlive, isAnimated, killUnit, setAlive, setAnimated, setIsAnimated, setOwner, setPosition, setSide, takeDamage
-
Constructor Details
-
Barracks
Constructs a new Barracks instance.- Parameters:
position
- the barrack's position on the Mapside
- the side it belongs to
-
Barracks
Constructs a new Barracks instance.- Parameters:
position
- the barrack's position on the Map
-
-
Method Details
-
isUpgraded
public boolean isUpgraded()Returns if the Barrack instance is upgraded.- Returns:
- if the Barrack instance is upgraded
-
setUpgraded
public void setUpgraded(boolean isUpgraded) Sets if the Barrack instance is upgraded.- Parameters:
isUpgraded
- if the Barrack instance is upgraded
-
upgrade
public void upgrade()Upgrades the Barrack instance. -
getUpgradeCost
public int getUpgradeCost()Returns the upgrade cost of the Barrack instance.- Specified by:
getUpgradeCost
in classBuilding
- Returns:
- the upgrade cost of the Barrack instance
-