|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.ManagedReferenceHolder
org.starhope.appius.sql.SQLPeerDatum
org.starhope.appius.user.InventoryItem
public abstract class InventoryItem
The InventoryItem is an abstract superclass for all items which can
be placed into the user's inventory. It also has interface elements
for the common behaviour of “equipping” the item in some way, giving
and receiving items (including purchasing them and trading with other
players), and so forth.
Subclasses are ClothingItem
, HomeDecorItem
,
MusicItem
, GameEquipItem
Field Summary | |
---|---|
protected boolean |
active
|
protected int |
id
|
protected int |
ownerID
user owning this item |
protected int |
slotNumber
The slot/series in which this occurs in the player's inventory |
static int |
Type_Backpacks
|
static int |
Type_Ceiling
|
static int |
Type_Ceiling_Furniture
|
static int |
Type_Dresses
|
static int |
Type_Ears
|
static int |
Type_Eyes
|
static int |
Type_Floor_Furniture
|
static int |
Type_Flooring
|
static int |
Type_Music
|
static int |
Type_Neck
|
static int |
Type_Orbitz
|
static int |
Type_Pants
|
static int |
Type_Pattern
|
static int |
Type_Pivitz
|
static int |
Type_Shirts
|
static int |
Type_Tops
|
static int |
Type_Wall_Furniture
|
static int |
Type_Wallpaper
|
protected int |
typeID
|
Constructor Summary | |
---|---|
InventoryItem()
|
Method Summary | |
---|---|
ClothingItem |
asClothing()
|
HomeDecorItem |
asHomeDecorItem()
|
protected abstract void |
assertValidTypeID(long testTypeID)
This is for subclasses to validate the type ID of their members. |
void |
flush()
This is an overriding method. |
static InventoryItem |
getByID(int idByWhichToGet)
Get an inventory item based upon the database ID |
static InventoryItem |
getByID(int id,
boolean isActive,
int slotNum)
WRITEME: document this method (brpocock, Aug 28, 2009) |
String |
getCacheUniqueID()
|
Class<? extends InventoryItem> |
getClassForThisType()
|
static Class<? extends InventoryItem> |
getClassForType(int theTypeID)
Find the class to which a type of item belongs. |
int |
getID()
|
Class<? extends InventoryItem> |
getItemClass()
|
String |
getMountPoint()
|
User |
getOwner()
|
int |
getOwnerID()
|
int |
getSlotNumber()
|
int |
getTypeID()
|
static int[] |
getTypesOfClothing()
|
static int[] |
getTypesOfFurniture()
|
static int[] |
getTypesOfStructure()
|
static int[] |
getTypesOfWearables()
|
boolean |
identifiesAs(String typeString)
|
boolean |
isActive()
WRITEME: document this method (brpocock, Aug 28, 2009) |
boolean |
isClothingOnly()
|
boolean |
isFurniture()
|
boolean |
isMusic()
|
boolean |
isPattern()
|
boolean |
isPivitz()
|
boolean |
isStructure()
|
boolean |
isWearable()
|
void |
setActive(boolean beActive)
|
void |
setOwner(User user)
|
void |
setOwnerID(int ownerID)
|
void |
setSlotNumber(int slot)
|
void |
setTypeID(int typeID)
|
org.json.JSONObject |
toJSON()
|
String |
toString()
|
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, findInCache, get, prepare, prepare, saveInCache, set, set |
Methods inherited from class org.starhope.appius.util.ManagedReferenceHolder |
---|
deref, setRef |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int Type_Backpacks
public static final int Type_Ceiling
public static final int Type_Ceiling_Furniture
public static final int Type_Dresses
public static final int Type_Ears
public static final int Type_Eyes
public static final int Type_Floor_Furniture
public static final int Type_Flooring
public static final int Type_Music
public static final int Type_Neck
public static final int Type_Orbitz
public static final int Type_Pants
public static final int Type_Pattern
public static final int Type_Pivitz
public static final int Type_Shirts
public static final int Type_Tops
public static final int Type_Wall_Furniture
public static final int Type_Wallpaper
protected boolean active
protected int id
protected int ownerID
protected int slotNumber
protected int typeID
Constructor Detail |
---|
public InventoryItem()
Method Detail |
---|
public static InventoryItem getByID(int idByWhichToGet)
idByWhichToGet
- the database ID of an inventory item of any
kind
public static InventoryItem getByID(int id, boolean isActive, int slotNum)
id
- isActive
- slotNum
-
public static Class<? extends InventoryItem> getClassForType(int theTypeID)
theTypeID
- The ID number for a type of item
public static int[] getTypesOfClothing()
public static int[] getTypesOfFurniture()
public static int[] getTypesOfStructure()
public static int[] getTypesOfWearables()
public ClothingItem asClothing()
public HomeDecorItem asHomeDecorItem()
protected abstract void assertValidTypeID(long testTypeID) throws GameLogicException
testTypeID
- The type ID to be checked
GameLogicException
- if the type ID is not of the types
supported by this classpublic void flush()
flush
in class SQLPeerDatum
SQLPeerDatum.flush()
public String getCacheUniqueID()
getCacheUniqueID
in class SQLPeerDatum
SQLPeerDatum.getCacheUniqueID()
public Class<? extends InventoryItem> getClassForThisType()
public int getID()
public Class<? extends InventoryItem> getItemClass()
public String getMountPoint()
public User getOwner()
public int getOwnerID()
public int getSlotNumber()
slotNumber
public int getTypeID()
public boolean identifiesAs(String typeString)
typeString
- the type of item from the following list of
strings: "clothes" "patterns" "pivitz" "furniture"
"structure" "music"
public boolean isActive()
public boolean isClothingOnly()
public boolean isFurniture()
public boolean isMusic()
public boolean isPattern()
public boolean isPivitz()
public boolean isStructure()
public boolean isWearable()
public void setActive(boolean beActive)
beActive
- true if the item is activepublic void setOwner(User user)
user
- ownerpublic void setOwnerID(int ownerID)
ownerID
- owner's userIDpublic void setSlotNumber(int slot)
slot
- new slot numberpublic void setTypeID(int typeID) throws GameLogicException
typeID
- the new type ID
GameLogicException
- if the type ID is not validpublic org.json.JSONObject toJSON()
toJSON
in class SQLPeerDatum
SQLPeerDatum.toJSON()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |