Class WeaponStorage

  • All Implemented Interfaces:
    IWeaponStorage

    public class WeaponStorage
    extends java.lang.Object
    implements IWeaponStorage
    Implementation for the storage of weapons
    Author:
    Andi Hotz, (c) Sahits GmbH, 2012 Created on Jul 25, 2012
    • Constructor Detail

      • WeaponStorage

        public WeaponStorage()
    • Method Detail

      • init

        @PostConstruct
        private void init()
      • getWeapon

        public int getWeapon​(IWeapon weapon)
        Description copied from interface: IWeaponStorage
        Retrieve the amount of weapons in storage
        Specified by:
        getWeapon in interface IWeaponStorage
        Parameters:
        weapon - for which to retrieve the amount
        Returns:
        amount of weapon stored.
      • update

        public int update​(IWeapon weapon,
                          int amount)
        Description copied from interface: IWeaponStorage
        Move weapons in or out of storage
        Specified by:
        update in interface IWeaponStorage
        Parameters:
        weapon - type of weapon
        amount - to be moved (positive means into the storage, negative out of the storage)
        Returns:
        amount that is moved
      • hasWeapons

        public boolean hasWeapons()
        Description copied from interface: IWeaponStorage
        check if there are any weapons stored
        Specified by:
        hasWeapons in interface IWeaponStorage
        Returns:
        true if weapons are stored
      • getWeaponProperty

        public javafx.beans.property.ReadOnlyIntegerProperty getWeaponProperty​(IWeapon weapon)
        Description copied from interface: IWeaponStorage
        Retrieve the property holding the mount of stored weapons of the indicated type.
        Specified by:
        getWeaponProperty in interface IWeaponStorage
        Parameters:
        weapon - for which to retrieve the amount
        Returns:
        read only property of the amount of stored weapon