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 Summary

      Constructors 
      Constructor Description
      WeaponStorage()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getWeapon​(IWeapon weapon)
      Retrieve the amount of weapons in storage
      javafx.beans.property.ReadOnlyIntegerProperty getWeaponProperty​(IWeapon weapon)
      Retrieve the property holding the mount of stored weapons of the indicated type.
      boolean hasWeapons()
      check if there are any weapons stored
      int update​(IWeapon weapon, int amount)
      Move weapons in or out of storage
      • Methods inherited from class java.lang.Object

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

      • WeaponStorage

        public WeaponStorage()
    • Method Detail

      • 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