Class WeaponStorage
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.building.impl.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 intgetWeapon(IWeapon weapon)Retrieve the amount of weapons in storagejavafx.beans.property.ReadOnlyIntegerPropertygetWeaponProperty(IWeapon weapon)Retrieve the property holding the mount of stored weapons of the indicated type.booleanhasWeapons()check if there are any weapons storedintupdate(IWeapon weapon, int amount)Move weapons in or out of storage
-
-
-
Method Detail
-
getWeapon
public int getWeapon(IWeapon weapon)
Description copied from interface:IWeaponStorageRetrieve the amount of weapons in storage- Specified by:
getWeaponin interfaceIWeaponStorage- Parameters:
weapon- for which to retrieve the amount- Returns:
- amount of
weaponstored.
-
update
public int update(IWeapon weapon, int amount)
Description copied from interface:IWeaponStorageMove weapons in or out of storage- Specified by:
updatein interfaceIWeaponStorage- Parameters:
weapon- type of weaponamount- 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:IWeaponStoragecheck if there are any weapons stored- Specified by:
hasWeaponsin interfaceIWeaponStorage- Returns:
- true if weapons are stored
-
getWeaponProperty
public javafx.beans.property.ReadOnlyIntegerProperty getWeaponProperty(IWeapon weapon)
Description copied from interface:IWeaponStorageRetrieve the property holding the mount of stored weapons of the indicated type.- Specified by:
getWeaponPropertyin interfaceIWeaponStorage- Parameters:
weapon- for which to retrieve the amount- Returns:
- read only property of the amount of stored
weapon
-
-