Class Armory

  • All Implemented Interfaces:
    IArmory

    public class Armory
    extends java.lang.Object
    implements IArmory
    Author:
    Andi Hotz, (c) Sahits GmbH, 2017 Created on Jul 27, 2017
    • Constructor Summary

      Constructors 
      Constructor Description
      Armory​(ICity city)  
    • 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 priority
      boolean isCrossbowPriority()
      Indicate that the crossbow should be produced with priority
      boolean isMusketPriority()
      Indicate that the musket should be produced with priority
      boolean isSwordPriority()
      Indicate that the sword should be produced with priority
      javafx.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 the delta amount
      void updateBallistaSmallAmount​(int delta)
      Update the amount of small ballista by the delta amount
      void updateBombardAmount​(int delta)
      Update the amount of bombard by the delta amount
      void updateBowAmount​(int delta)
      Update the amount of bows by the delta amount
      void updateCanonAmount​(int delta)
      Update the amount of canon by the delta amount
      void updateCrossbowAmount​(int delta)
      Update the amount of crossbows by the delta amount
      void updateCutlassAmount​(int delta)
      Update the amount of hand weapon by the delta amount
      void updateMusketAmount​(int delta)
      Update the amount of musket by the delta amount
      void updateSwordAmount​(int delta)
      Update the amount of swords by the delta amount
      void updateTrebuchetBigAmount​(int delta)
      Update the amount of big trebuchet by the delta amount
      void updateTrebuchetSmallAmount​(int delta)
      Update the amount of small trebuchet by the delta amount
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
        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 interface IArmory
      • toggleBowPriority

        public void toggleBowPriority()
        Description copied from interface: IArmory
        Toggle the priority of the bow.
        Specified by:
        toggleBowPriority in interface IArmory
      • toggleCrossbowPriority

        public void toggleCrossbowPriority()
        Description copied from interface: IArmory
        Toggle the priority of the crossbow.
        Specified by:
        toggleCrossbowPriority in interface IArmory
      • toggleMusketPriority

        public void toggleMusketPriority()
        Description copied from interface: IArmory
        Toggle the priority of the musket.
        Specified by:
        toggleMusketPriority in interface IArmory
      • updateSwordAmount

        public void updateSwordAmount​(int delta)
        Description copied from interface: IArmory
        Update the amount of swords by the delta amount
        Specified by:
        updateSwordAmount in interface IArmory
        Parameters:
        delta - amount to be changed.
      • updateBowAmount

        public void updateBowAmount​(int delta)
        Description copied from interface: IArmory
        Update the amount of bows by the delta amount
        Specified by:
        updateBowAmount in interface IArmory
        Parameters:
        delta - amount to be changed.
      • updateCrossbowAmount

        public void updateCrossbowAmount​(int delta)
        Description copied from interface: IArmory
        Update the amount of crossbows by the delta amount
        Specified by:
        updateCrossbowAmount in interface IArmory
        Parameters:
        delta - amount to be changed.
      • updateMusketAmount

        public void updateMusketAmount​(int delta)
        Description copied from interface: IArmory
        Update the amount of musket by the delta amount
        Specified by:
        updateMusketAmount in interface IArmory
        Parameters:
        delta - amount to be changed.
      • updateCutlassAmount

        public void updateCutlassAmount​(int delta)
        Description copied from interface: IArmory
        Update the amount of hand weapon by the delta amount
        Specified by:
        updateCutlassAmount in interface IArmory
        Parameters:
        delta - amount to be changed.
      • updateTrebuchetSmallAmount

        public void updateTrebuchetSmallAmount​(int delta)
        Description copied from interface: IArmory
        Update the amount of small trebuchet by the delta amount
        Specified by:
        updateTrebuchetSmallAmount in interface IArmory
        Parameters:
        delta - amount to be changed.
      • updateTrebuchetBigAmount

        public void updateTrebuchetBigAmount​(int delta)
        Description copied from interface: IArmory
        Update the amount of big trebuchet by the delta amount
        Specified by:
        updateTrebuchetBigAmount in interface IArmory
        Parameters:
        delta - amount to be changed.
      • updateBallistaSmallAmount

        public void updateBallistaSmallAmount​(int delta)
        Description copied from interface: IArmory
        Update the amount of small ballista by the delta amount
        Specified by:
        updateBallistaSmallAmount in interface IArmory
        Parameters:
        delta - amount to be changed.
      • updateBallistaBigAmount

        public void updateBallistaBigAmount​(int delta)
        Description copied from interface: IArmory
        Update the amount of big ballista by the delta amount
        Specified by:
        updateBallistaBigAmount in interface IArmory
        Parameters:
        delta - amount to be changed.
      • updateBombardAmount

        public void updateBombardAmount​(int delta)
        Description copied from interface: IArmory
        Update the amount of bombard by the delta amount
        Specified by:
        updateBombardAmount in interface IArmory
        Parameters:
        delta - amount to be changed.
      • updateCanonAmount

        public void updateCanonAmount​(int delta)
        Description copied from interface: IArmory
        Update the amount of canon by the delta amount
        Specified by:
        updateCanonAmount in interface IArmory
        Parameters:
        delta - amount to be changed.
      • gainExperience

        public void gainExperience()
        Description copied from interface: IArmory
        Increase the experience.
        Specified by:
        gainExperience in interface IArmory
      • occupiedUntil

        public java.time.LocalDateTime occupiedUntil()
        Description copied from interface: IArmory
        Date until the blacksmith has work.
        Specified by:
        occupiedUntil in interface IArmory
        Returns:
        date until the blacksmith is working
      • occupy

        public void occupy​(java.time.LocalDateTime date)
        Description copied from interface: IArmory
        Date in the future until which the blacksmith has work.
        Specified by:
        occupy in interface IArmory
        Parameters:
        date - set the date until the blacksmith is working