|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.sql.SQLPeerDatum
org.starhope.appius.game.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
TODO: document this field (brpocock, Nov 19, 2009) active (InventoryItem) |
static String |
CLOTHES
WRITEME: Document this field. |
static String |
FURNITURE
String for identifiesAs(String) for furniture |
static String |
GAME_EQUIP_ITEM
String for identifiesAs(String) for game equippable
items |
protected int |
id
|
static String |
MUSIC
String for identifiesAs(String) for music |
protected int |
ownerID
user owning this item |
static String |
PATTERNS
WRITEME: Document this field. |
private static String |
PET
WRITEME: Document this field. |
static String |
PIVITZ
WRITEME: Document this field. |
private static long |
serialVersionUID
Java serialization version unique ID serialVersionUID (long) |
protected int |
slotNumber
The slot/series in which this occurs in the player's inventory |
static String |
STATIONERY
WRITEME: Document this field. |
static String |
STRUCTURE
WRITEME: Document this field. |
static InventoryItemType |
T_Backpacks
Backpacks, færie wings, and the like (clothing) |
static InventoryItemType |
T_Ceiling
ceilings for houses (structure) |
static InventoryItemType |
T_Ceiling_Furniture
WRITEME |
static InventoryItemType |
T_Dresses
WRITEME |
static InventoryItemType |
T_Ears
WRITEME |
static InventoryItemType |
T_Eyes
WRITEME |
static InventoryItemType |
T_Floor_Furniture
WRITEME |
static InventoryItemType |
T_Flooring
WRITEME |
static InventoryItemType |
T_Game_Equip_Item
TODO: document this field (brpocock, Nov 19, 2009) T_Game_Equip_Item (InventoryItem) |
static InventoryItemType |
T_Music
WRITEME |
static InventoryItemType |
T_Neck
WRITEME |
static InventoryItemType |
T_Orbitz
WRITEME |
static InventoryItemType |
T_Pants
WRITEME |
static InventoryItemType |
T_Pattern
WRITEME |
static InventoryItemType |
T_Pet
TODO: document this field (brpocock, Nov 24, 2009) T_Pet (InventoryItem) |
static InventoryItemType |
T_Pivitz
WRITEME |
static InventoryItemType |
T_Shirts
WRITEME |
static InventoryItemType |
T_Stationery
TODO: document this field (brpocock, Nov 19, 2009) T_Stationery (InventoryItem) |
static InventoryItemType |
T_TootBook_Avatar_BG
TODO: document this field (brpocock, Nov 19, 2009) T_Stationery (InventoryItem) |
static InventoryItemType |
T_TootBook_Box_Style
TODO: document this field (brpocock, Nov 19, 2009) T_Stationery (InventoryItem) |
static InventoryItemType |
T_TootBook_Icon
TODO: document this field (brpocock, Nov 19, 2009) T_Stationery (InventoryItem) |
static InventoryItemType |
T_TootBook_Page_BG
TODO: document this field (brpocock, Nov 19, 2009) T_Stationery (InventoryItem) |
static InventoryItemType |
T_TootBook_Title_BG
TODO: document this field (brpocock, Nov 19, 2009) T_Stationery (InventoryItem) |
static InventoryItemType |
T_TootBookTheme
TODO: document this field (brpocock, Nov 19, 2009) T_TootBookTheme (InventoryItem) |
static InventoryItemType |
T_Tops
WRITEME |
static InventoryItemType |
T_Vehicle
TODO: document this field (brpocock, Nov 24, 2009) T_Vehicle (InventoryItem) |
static InventoryItemType |
T_Wall_Furniture
WRITEME |
static InventoryItemType |
T_Wallpaper
WRITEME |
static String |
TB_AVATAR_BG
WRITEME: Document this field. |
static String |
TB_BOX_STYLES
WRITEME: Document this field. |
static String |
TB_ICON
WRITEME: Document this field. |
static String |
TB_PAGE_BG
WRITEME: Document this field. |
static String |
TB_TITLE_BG
WRITEME: Document this field. |
protected InventoryItemType |
type
WRITEME |
static int |
Type_Backpacks
WRITEME |
static int |
Type_Ceiling
WRITEME |
static int |
Type_Ceiling_Furniture
WRITEME |
static int |
Type_Dresses
WRITEME |
static int |
Type_Ears
WRITEME |
static int |
Type_Eyes
WRITEME |
static int |
Type_Floor_Furniture
WRITEME |
static int |
Type_Flooring
WRITEME |
static int |
Type_Music
WRITEME |
static int |
Type_Neck
WRITEME |
static int |
Type_Orbitz
WRITEME |
static int |
Type_Pants
WRITEME |
static int |
Type_Pattern
WRITEME |
static int |
Type_Pivitz
WRITEME |
static int |
Type_Shirts
WRITEME |
static int |
Type_Tops
WRITEME |
static int |
Type_Wall_Furniture
WRITEME |
static int |
Type_Wallpaper
WRITEME |
private static String |
VEHICLE
WRITEME: Document this field. |
Fields inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
hackyDatabaseConnection |
Constructor Summary | |
---|---|
InventoryItem()
|
Method Summary | |
---|---|
ClothingItem |
asClothing()
|
HomeDecorItem |
asHomeDecorItem()
|
protected abstract void |
assertValidType(InventoryItemType t)
TODO: document this method (brpocock, Nov 19, 2009) |
protected void |
assertValidTypeID(long testTypeID)
This is for subclasses to validate the type ID of their members. |
boolean |
equals(Object obj)
|
void |
equip()
TODO: document this method (brpocock, Nov 24, 2009) |
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. |
static Class<? extends InventoryItem> |
getClassForType(InventoryItemType theType)
TODO: document this method (brpocock, Nov 19, 2009) |
static InventoryItem |
getFromInventory(ResultSet inv)
|
int |
getID()
|
Class<? extends InventoryItem> |
getItemClass()
|
String |
getMountPoint()
|
User |
getOwner()
|
int |
getOwnerID()
|
int |
getSlotNumber()
|
InventoryItemType |
getType()
WRITEME |
int |
getTypeID()
|
static InventoryItemType[] |
getTypesOfClothingT()
|
static InventoryItemType[] |
getTypesOfFurnitureT()
|
static InventoryItemType[] |
getTypesOfHomeDecorT()
TODO: document this method (brpocock, Nov 19, 2009) |
static InventoryItemType[] |
getTypesOfStructureT()
|
static InventoryItemType[] |
getTypesOfWearablesT()
|
boolean |
hasANomen()
True if this is a nominable type of item |
int |
hashCode()
This is an overriding method. |
boolean |
identifiesAs(String typeString)
Compares a string against a list of constants to retrieve an item type. |
boolean |
isActive()
WRITEME: document this method (brpocock, Aug 28, 2009) |
boolean |
isAPet()
TODO: document this method (brpocock, Nov 24, 2009) |
boolean |
isClothingOnly()
|
boolean |
isFurniture()
|
private boolean |
isGameEquipItem()
|
boolean |
isMusic()
|
boolean |
isPattern()
|
boolean |
isPet()
TODO: document this method (brpocock, Nov 24, 2009) |
boolean |
isPivitz()
|
private boolean |
isStationery()
|
boolean |
isStructure()
|
private boolean |
isTootBookAvatarBG()
|
private boolean |
isTootBookBoxStyle()
|
private boolean |
isTootBookIcon()
|
private boolean |
isTootBookPageBG()
|
private boolean |
isTootBookTitleBG()
|
boolean |
isVehicle()
TODO: document this method (brpocock, Nov 25, 2009) |
boolean |
isWearable()
|
static InventoryItem |
pullFromInventory(int id,
int userID)
WRITEME: document this method (brpocock, Sep 9, 2009) |
void |
setActive(boolean beActive)
|
protected abstract void |
setFromInventory(ResultSet inv)
TODO: document this method (brpocock, Nov 19, 2009) |
void |
setOwner(User user)
|
void |
setOwnerID(int ownerID1)
|
void |
setSlotHarsh(int slotNumber_force)
This is only to be used by addItem. |
void |
setSlotNumber(int slot)
|
void |
setType(InventoryItemType type2)
WRITEME |
void |
setTypeID(int typeID1)
|
org.json.JSONObject |
toJSON()
This is the default SQLPeerDatum implementation of toJSON. |
String |
toString()
This is an overriding method. |
void |
unequip()
TODO: document this method (brpocock, Nov 24, 2009) |
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, findInCache, get, prepareX, prepareX, saveInCache, set, set |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CLOTHES
public static final String FURNITURE
identifiesAs(String)
for furniture
public static final String GAME_EQUIP_ITEM
identifiesAs(String)
for game equippable
items
public static final String MUSIC
identifiesAs(String)
for music
public static final String PATTERNS
private static final String PET
public static final String PIVITZ
private static final long serialVersionUID
public static final String STATIONERY
public static final String STRUCTURE
public static final InventoryItemType T_Backpacks
public static final InventoryItemType T_Ceiling
public static final InventoryItemType T_Ceiling_Furniture
public static final InventoryItemType T_Dresses
public static final InventoryItemType T_Ears
public static final InventoryItemType T_Eyes
public static final InventoryItemType T_Floor_Furniture
public static final InventoryItemType T_Flooring
public static final InventoryItemType T_Game_Equip_Item
public static final InventoryItemType T_Music
public static final InventoryItemType T_Neck
public static final InventoryItemType T_Orbitz
public static final InventoryItemType T_Pants
public static final InventoryItemType T_Pattern
public static final InventoryItemType T_Pet
public static final InventoryItemType T_Pivitz
public static final InventoryItemType T_Shirts
public static final InventoryItemType T_Stationery
public static final InventoryItemType T_TootBook_Avatar_BG
public static final InventoryItemType T_TootBook_Box_Style
public static final InventoryItemType T_TootBook_Icon
public static final InventoryItemType T_TootBook_Page_BG
public static final InventoryItemType T_TootBook_Title_BG
public static final InventoryItemType T_TootBookTheme
public static final InventoryItemType T_Tops
public static final InventoryItemType T_Vehicle
public static final InventoryItemType T_Wall_Furniture
public static final InventoryItemType T_Wallpaper
public static final String TB_AVATAR_BG
public static final String TB_BOX_STYLES
public static final String TB_ICON
public static final String TB_PAGE_BG
public static final String TB_TITLE_BG
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
private static final String VEHICLE
protected boolean active
protected int id
protected int ownerID
protected int slotNumber
protected InventoryItemType type
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
- WRITEMEisActive
- WRITEMEslotNum
- WRITEME
public static Class<? extends InventoryItem> getClassForType(int theTypeID)
theTypeID
- The ID number for a type of item
public static Class<? extends InventoryItem> getClassForType(InventoryItemType theType)
theType
- WRITEME
public static InventoryItem getFromInventory(ResultSet inv)
inv
- WRITEME
public static InventoryItemType[] getTypesOfClothingT()
public static InventoryItemType[] getTypesOfFurnitureT()
public static InventoryItemType[] getTypesOfHomeDecorT()
public static InventoryItemType[] getTypesOfStructureT()
public static InventoryItemType[] getTypesOfWearablesT()
public static InventoryItem pullFromInventory(int id, int userID) throws NotFoundException
id
- WRITEMEuserID
- WRITEME
NotFoundException
- WRITEMEpublic ClothingItem asClothing()
public HomeDecorItem asHomeDecorItem()
protected abstract void assertValidType(InventoryItemType t) throws GameLogicException
t
- WRITEME
GameLogicException
- WRITEMEprotected 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 boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public void equip()
public 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 InventoryItemType getType()
public int getTypeID()
public boolean hasANomen()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean identifiesAs(String typeString)
Clothes: CLOTHES
Patterns: PATTERNS
Pivits: PIVITZ
Furniture: FURNITURE
Structure: STRUCTURE
TootBook Avatar BG: TB_AVATAR_BG
TootBook Box Styles: TB_BOX_STYLES
TootBook Icons: TB_ICON
TootBook Page BG: TB_PAGE_BG
TootBook Title BG: TB_TITLE_BG
Stationary: STATIONERY
Game Equip Item: GAME_EQUIP_ITEM
Music: MUSIC
Vehicle: VEHICLE
Pet: PET
typeString
- the type of item from the following list of
strings: "clothes" "patterns" "pivitz" "furniture"
"structure" "music" "tootBookTheme" "stationery"
"gameEquipItem"
public boolean isActive()
public boolean isAPet()
public boolean isClothingOnly()
public boolean isFurniture()
private boolean isGameEquipItem()
public boolean isMusic()
public boolean isPattern()
public boolean isPet()
public boolean isPivitz()
private boolean isStationery()
public boolean isStructure()
private boolean isTootBookAvatarBG()
private boolean isTootBookBoxStyle()
private boolean isTootBookIcon()
private boolean isTootBookPageBG()
private boolean isTootBookTitleBG()
public boolean isVehicle()
public boolean isWearable()
public void setActive(boolean beActive)
beActive
- true if the item is activeprotected abstract void setFromInventory(ResultSet inv) throws SQLException
inv
- WRITEME
SQLException
- WRITEMEpublic void setOwner(User user)
user
- ownerpublic void setOwnerID(int ownerID1)
ownerID1
- owner's userIDpublic void setSlotHarsh(int slotNumber_force)
slotNumber_force
- The retrieved slot number from an insert.public void setSlotNumber(int slot)
slot
- new slot numberpublic void setType(InventoryItemType type2)
type2
- WRITEMEpublic void setTypeID(int typeID1) throws GameLogicException
typeID1
- the new type ID
GameLogicException
- if the type ID is not validpublic org.json.JSONObject toJSON()
SQLPeerDatum
toJSON
in class SQLPeerDatum
SQLPeerDatum.toJSON()
public String toString()
toString
in class Object
Object.toString()
public void unequip()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |