Class Armory
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.impl.Armory
-
-
Field Summary
Fields Modifier and Type Field Description private ICity
city
private Date
date
private double
experience
Value between 0 and 1 detailing the experience of the ship yard crew (the higher the better)private static double
EXPERIENCE_GAIN
private IMap
map
private java.time.LocalDateTime
occupied
Date until which the blacksmith is covered with work.private java.util.HashMap<IWeapon,java.lang.Boolean>
priority
private IWeaponStorage
weaponStorage
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.ReadOnlyIntegerProperty
ballistaBigAmountProperty()
Property holding the amount of big ballista in the storage.javafx.beans.property.ReadOnlyIntegerProperty
ballistaSmallAmountProperty()
Property holding the amount of small ballista in the storage.javafx.beans.property.ReadOnlyIntegerProperty
bombardAmountProperty()
Property holding the amount of bombard in the storage.javafx.beans.property.ReadOnlyIntegerProperty
bowAmountProperty()
Property holding the amount of bows in the storage.javafx.beans.property.ReadOnlyIntegerProperty
canonAmountProperty()
Property holding the amount of canon in the storage.javafx.beans.property.ReadOnlyIntegerProperty
crossbowAmountProperty()
Property holding the amount of crossbows in the storage.javafx.beans.property.ReadOnlyIntegerProperty
cutlassAmountProperty()
Property holding the amount of hand weapons in the storage.void
gainExperience()
Increase the experience.private void
init()
boolean
isBowPriority()
Indicate that the bow should be produced with priorityboolean
isCrossbowPriority()
Indicate that the crossbow should be produced with priorityboolean
isMusketPriority()
Indicate that the musket should be produced with priorityboolean
isSwordPriority()
Indicate that the sword should be produced with priorityjavafx.beans.property.ReadOnlyIntegerProperty
musketAmountProperty()
Property holding the amount of musket in the storage.java.time.LocalDateTime
occupiedUntil()
Date until the blacksmith has work.void
occupy(java.time.LocalDateTime date)
Date in the future until which the blacksmith has work.javafx.beans.property.ReadOnlyIntegerProperty
swordAmountProperty()
Property holding the amount of swords in the storage.void
toggleBowPriority()
Toggle the priority of the bow.void
toggleCrossbowPriority()
Toggle the priority of the crossbow.void
toggleMusketPriority()
Toggle the priority of the musket.void
toggleSwordPriority()
Toggle the priority of the sword.javafx.beans.property.ReadOnlyIntegerProperty
trebuchetBigAmountProperty()
Property holding the amount of big trebuchet in the storage.javafx.beans.property.ReadOnlyIntegerProperty
trebuchetSmallAmountProperty()
Property holding the amount of small trebuchet in the storage.void
updateBallistaBigAmount(int delta)
Update the amount of big ballista by thedelta
amountvoid
updateBallistaSmallAmount(int delta)
Update the amount of small ballista by thedelta
amountvoid
updateBombardAmount(int delta)
Update the amount of bombard by thedelta
amountvoid
updateBowAmount(int delta)
Update the amount of bows by thedelta
amountvoid
updateCanonAmount(int delta)
Update the amount of canon by thedelta
amountvoid
updateCrossbowAmount(int delta)
Update the amount of crossbows by thedelta
amountvoid
updateCutlassAmount(int delta)
Update the amount of hand weapon by thedelta
amountvoid
updateMusketAmount(int delta)
Update the amount of musket by thedelta
amountvoid
updateSwordAmount(int delta)
Update the amount of swords by thedelta
amountvoid
updateTrebuchetBigAmount(int delta)
Update the amount of big trebuchet by thedelta
amountvoid
updateTrebuchetSmallAmount(int delta)
Update the amount of small trebuchet by thedelta
amount-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ch.sahits.game.openpatrician.model.weapon.IArmory
getExperience
-
-
-
-
Field Detail
-
EXPERIENCE_GAIN
private static final double EXPERIENCE_GAIN
- See Also:
- Constant Field Values
-
weaponStorage
@Autowired private IWeaponStorage weaponStorage
-
date
@Autowired private Date date
-
map
@Autowired private IMap map
-
city
private final ICity city
-
priority
private java.util.HashMap<IWeapon,java.lang.Boolean> priority
-
experience
private double experience
Value between 0 and 1 detailing the experience of the ship yard crew (the higher the better)
-
occupied
private java.time.LocalDateTime occupied
Date until which the blacksmith is covered with work.
-
-
Constructor Detail
-
Armory
public Armory(ICity city)
-
-
Method Detail
-
init
@PostConstruct private void init()
-
swordAmountProperty
public javafx.beans.property.ReadOnlyIntegerProperty swordAmountProperty()
Description copied from interface:IArmory
Property holding the amount of swords in the storage.- Specified by:
swordAmountProperty
in interfaceIArmory
- Returns:
- amount of swords in the armory as read only property
-
bowAmountProperty
public javafx.beans.property.ReadOnlyIntegerProperty bowAmountProperty()
Description copied from interface:IArmory
Property holding the amount of bows in the storage.- Specified by:
bowAmountProperty
in interfaceIArmory
- Returns:
- amount of bows in the armory as read only property
-
crossbowAmountProperty
public javafx.beans.property.ReadOnlyIntegerProperty crossbowAmountProperty()
Description copied from interface:IArmory
Property holding the amount of crossbows in the storage.- Specified by:
crossbowAmountProperty
in interfaceIArmory
- Returns:
- amount of crossbows in the armory as read only property
-
musketAmountProperty
public javafx.beans.property.ReadOnlyIntegerProperty musketAmountProperty()
Description copied from interface:IArmory
Property holding the amount of musket in the storage.- Specified by:
musketAmountProperty
in interfaceIArmory
- Returns:
- amount of muskets in the armory as read only property
-
cutlassAmountProperty
public javafx.beans.property.ReadOnlyIntegerProperty cutlassAmountProperty()
Description copied from interface:IArmory
Property holding the amount of hand weapons in the storage.- Specified by:
cutlassAmountProperty
in interfaceIArmory
- Returns:
- amount of cutlass in the armory as read only property
-
trebuchetSmallAmountProperty
public javafx.beans.property.ReadOnlyIntegerProperty trebuchetSmallAmountProperty()
Description copied from interface:IArmory
Property holding the amount of small trebuchet in the storage.- Specified by:
trebuchetSmallAmountProperty
in interfaceIArmory
- Returns:
- amount of small trebuchet in the armory as read only property
-
trebuchetBigAmountProperty
public javafx.beans.property.ReadOnlyIntegerProperty trebuchetBigAmountProperty()
Description copied from interface:IArmory
Property holding the amount of big trebuchet in the storage.- Specified by:
trebuchetBigAmountProperty
in interfaceIArmory
- Returns:
- amount of big trebuchhet in the armory as read only property
-
ballistaSmallAmountProperty
public javafx.beans.property.ReadOnlyIntegerProperty ballistaSmallAmountProperty()
Description copied from interface:IArmory
Property holding the amount of small ballista in the storage.- Specified by:
ballistaSmallAmountProperty
in interfaceIArmory
- Returns:
- amount of small ballista in the armory as read only property
-
ballistaBigAmountProperty
public javafx.beans.property.ReadOnlyIntegerProperty ballistaBigAmountProperty()
Description copied from interface:IArmory
Property holding the amount of big ballista in the storage.- Specified by:
ballistaBigAmountProperty
in interfaceIArmory
- Returns:
- amount of big ballista in the armory as read only property
-
bombardAmountProperty
public javafx.beans.property.ReadOnlyIntegerProperty bombardAmountProperty()
Description copied from interface:IArmory
Property holding the amount of bombard in the storage.- Specified by:
bombardAmountProperty
in interfaceIArmory
- Returns:
- amount of bombard in the armory as read only property
-
canonAmountProperty
public javafx.beans.property.ReadOnlyIntegerProperty canonAmountProperty()
Description copied from interface:IArmory
Property holding the amount of canon in the storage.- Specified by:
canonAmountProperty
in interfaceIArmory
- Returns:
- amount of canon in the armory as read only property
-
isSwordPriority
public boolean isSwordPriority()
Description copied from interface:IArmory
Indicate that the sword should be produced with priority- Specified by:
isSwordPriority
in interfaceIArmory
- Returns:
- true if the sword is prioritized
-
isBowPriority
public boolean isBowPriority()
Description copied from interface:IArmory
Indicate that the bow should be produced with priority- Specified by:
isBowPriority
in interfaceIArmory
- Returns:
- true if the bow is prioritized
-
isCrossbowPriority
public boolean isCrossbowPriority()
Description copied from interface:IArmory
Indicate that the crossbow should be produced with priority- Specified by:
isCrossbowPriority
in interfaceIArmory
- Returns:
- true if the crossbow is prioritized
-
isMusketPriority
public boolean isMusketPriority()
Description copied from interface:IArmory
Indicate that the musket should be produced with priority- Specified by:
isMusketPriority
in interfaceIArmory
- Returns:
- true if the musket is prioritized.
-
toggleSwordPriority
public void toggleSwordPriority()
Description copied from interface:IArmory
Toggle the priority of the sword.- Specified by:
toggleSwordPriority
in interfaceIArmory
-
toggleBowPriority
public void toggleBowPriority()
Description copied from interface:IArmory
Toggle the priority of the bow.- Specified by:
toggleBowPriority
in interfaceIArmory
-
toggleCrossbowPriority
public void toggleCrossbowPriority()
Description copied from interface:IArmory
Toggle the priority of the crossbow.- Specified by:
toggleCrossbowPriority
in interfaceIArmory
-
toggleMusketPriority
public void toggleMusketPriority()
Description copied from interface:IArmory
Toggle the priority of the musket.- Specified by:
toggleMusketPriority
in interfaceIArmory
-
updateSwordAmount
public void updateSwordAmount(int delta)
Description copied from interface:IArmory
Update the amount of swords by thedelta
amount- Specified by:
updateSwordAmount
in interfaceIArmory
- Parameters:
delta
- amount to be changed.
-
updateBowAmount
public void updateBowAmount(int delta)
Description copied from interface:IArmory
Update the amount of bows by thedelta
amount- Specified by:
updateBowAmount
in interfaceIArmory
- Parameters:
delta
- amount to be changed.
-
updateCrossbowAmount
public void updateCrossbowAmount(int delta)
Description copied from interface:IArmory
Update the amount of crossbows by thedelta
amount- Specified by:
updateCrossbowAmount
in interfaceIArmory
- Parameters:
delta
- amount to be changed.
-
updateMusketAmount
public void updateMusketAmount(int delta)
Description copied from interface:IArmory
Update the amount of musket by thedelta
amount- Specified by:
updateMusketAmount
in interfaceIArmory
- Parameters:
delta
- amount to be changed.
-
updateCutlassAmount
public void updateCutlassAmount(int delta)
Description copied from interface:IArmory
Update the amount of hand weapon by thedelta
amount- Specified by:
updateCutlassAmount
in interfaceIArmory
- Parameters:
delta
- amount to be changed.
-
updateTrebuchetSmallAmount
public void updateTrebuchetSmallAmount(int delta)
Description copied from interface:IArmory
Update the amount of small trebuchet by thedelta
amount- Specified by:
updateTrebuchetSmallAmount
in interfaceIArmory
- Parameters:
delta
- amount to be changed.
-
updateTrebuchetBigAmount
public void updateTrebuchetBigAmount(int delta)
Description copied from interface:IArmory
Update the amount of big trebuchet by thedelta
amount- Specified by:
updateTrebuchetBigAmount
in interfaceIArmory
- Parameters:
delta
- amount to be changed.
-
updateBallistaSmallAmount
public void updateBallistaSmallAmount(int delta)
Description copied from interface:IArmory
Update the amount of small ballista by thedelta
amount- Specified by:
updateBallistaSmallAmount
in interfaceIArmory
- Parameters:
delta
- amount to be changed.
-
updateBallistaBigAmount
public void updateBallistaBigAmount(int delta)
Description copied from interface:IArmory
Update the amount of big ballista by thedelta
amount- Specified by:
updateBallistaBigAmount
in interfaceIArmory
- Parameters:
delta
- amount to be changed.
-
updateBombardAmount
public void updateBombardAmount(int delta)
Description copied from interface:IArmory
Update the amount of bombard by thedelta
amount- Specified by:
updateBombardAmount
in interfaceIArmory
- Parameters:
delta
- amount to be changed.
-
updateCanonAmount
public void updateCanonAmount(int delta)
Description copied from interface:IArmory
Update the amount of canon by thedelta
amount- Specified by:
updateCanonAmount
in interfaceIArmory
- Parameters:
delta
- amount to be changed.
-
gainExperience
public void gainExperience()
Description copied from interface:IArmory
Increase the experience.- Specified by:
gainExperience
in interfaceIArmory
-
occupiedUntil
public java.time.LocalDateTime occupiedUntil()
Description copied from interface:IArmory
Date until the blacksmith has work.- Specified by:
occupiedUntil
in interfaceIArmory
- Returns:
- date until the blacksmith is working
-
-