|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.game.inventory.ItemManager
public class ItemManager
The ItemManager handles side-effects of equipping and removing items for an user.
There are two main purposes to the inventory management performed in this class:
The effects of items can be bridged through scripted event handlers, which might be specific to a given generic item type, which is typically the effect of an ACTIVE item. ACTIVE effect items will respond to a given user interface demand (e.g. “press the (A) button” or “click on a target”) specific to their equipment type. For example, a player might have melée weapons and ranged weapons which respond to their (A) and (B) buttons. The equipment reaction slots for those items are simply (A) and (B). The items which respond, however, might actually mount in various equipment slots. A ranged weapon might be in the “Hat” slot, and the player might have a melée weapon in each of the “LeftHand” and “RightHand” slots. In this case, the action handling for the items will have to run together, presuming that there is no conflict in mounting them.
PASSIVE items will typically have ongoing status effects, but may also register scripted event hooks. For example, magic shoes might simultaneously grant the player access to the verb “Skipping,” as a basic movement action, but they also might increase the player's “Karma” statistic at the same time.
Field Summary | |
---|---|
private AvatarClass |
avatar
WRITEME: Document this brpocock@star-hope.org |
private Inventory |
inv
WRITEME: Document this brpocock@star-hope.org |
private AbstractUser |
owner
WRITEME: Document this brpocock@star-hope.org |
Constructor Summary | |
---|---|
ItemManager(AvatarClass avatarClass,
Inventory inventory)
WRITEME: Document this constructor brpocock@star-hope.org |
Method Summary | |
---|---|
private void |
addEffects(InventoryItem item)
WRITEME: Document this method brpocock@star-hope.org |
static ItemManager |
get(AbstractUser u)
WRITEME: Document this method brpocock@star-hope.org |
static ItemManager |
get(AvatarClass avatarClass,
Inventory inventory)
WRITEME: Document this method brpocock@star-hope.org |
AvatarClass |
getAvatarClass()
|
Collection<InventoryItem> |
getConflicts(InventoryItem item)
WRITEME: Document this method brpocock@star-hope.org |
Inventory |
getInventory()
|
private Collection<InventoryItem> |
getItemConflicts(InventoryItem item)
WRITEME: Document this method brpocock@star-hope.org |
AbstractUser |
getOwner()
|
private Collection<InventoryItem> |
getSlotConflicts(InventoryItem item)
WRITEME: Document this method brpocock@star-hope.org |
boolean |
noteDeEquip(InventoryItem item)
Acknowledge that an item has been de-equipped, and its status effects should be removed, and also remove any items that require this one to be equipped. |
boolean |
noteEquip(InventoryItem item)
Acknowledge that an item has been equipped, and its status effects should be applied, and conflicting items removed. |
void |
useEquipment(char slot,
String targetName,
Coord3D targetCoords)
WRITEME: Document this method brpocock@star-hope.org |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final AvatarClass avatar
private final Inventory inv
private final AbstractUser owner
Constructor Detail |
---|
public ItemManager(AvatarClass avatarClass, Inventory inventory)
avatarClass
- WRITEMEinventory
- WRITEMEMethod Detail |
---|
public static ItemManager get(AbstractUser u)
u
- WRITEME
public static ItemManager get(AvatarClass avatarClass, Inventory inventory)
avatarClass
- WRITEMEinventory
- WRITEME
private void addEffects(InventoryItem item)
item
- WRITEMEpublic AvatarClass getAvatarClass()
public Collection<InventoryItem> getConflicts(InventoryItem item) throws AlreadyUsedException
item
- WRITEME
AlreadyUsedException
- if conflicts can't be determined
because the item couldn't be equipped due to slot or
valence restrictionspublic Inventory getInventory()
private Collection<InventoryItem> getItemConflicts(InventoryItem item) throws AlreadyUsedException
item
- WRITEME
AlreadyUsedException
- if the item can't be equipped due to
lack of a slot on the avatar for items of this typepublic AbstractUser getOwner()
private Collection<InventoryItem> getSlotConflicts(InventoryItem item) throws AlreadyUsedException
item
- WRITEME
AlreadyUsedException
- if there is not a slot or valence
free for this item at allpublic boolean noteDeEquip(InventoryItem item)
item
- the item being de-equipped
public boolean noteEquip(InventoryItem item)
item
- the item being equipped
public void useEquipment(char slot, String targetName, Coord3D targetCoords)
slot
- WRITEMEtargetName
- WRITEMEtargetCoords
- WRITEME
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |