cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor
Class ItemDescriptor
java.lang.Object
cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.ItemDescriptor
- Direct Known Subclasses:
- AdrenalineDescriptor, AmmoDescriptor, ArmorDescriptor, GeneralDescriptor, HealthDescriptor, OtherDescriptor, ShieldDescriptor, WeaponDescriptor
public class ItemDescriptor
- extends java.lang.Object
A parent of all item descriptors.
Contains attributes common for all descriptors plus some common functions.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ItemDescriptor
public ItemDescriptor()
getAmount
public int getAmount()
getInventoryType
public java.lang.String getInventoryType()
getPickupType
public ItemType getPickupType()
getItemCategory
public ItemType.Category getItemCategory()
fieldToName
protected java.lang.String fieldToName(java.lang.String string)
- Converts a fully qualified field name (e.g. private boolean cz.cuni.amis.MyClass.myBoolean)
to a field name (e.g. myBoolean).
- Parameters:
string
- - complete identifier of a field in a class
- Returns:
- name of a field
firstCharToUpperCase
protected java.lang.String firstCharToUpperCase(java.lang.String input)
doReflexion
protected void doReflexion(java.lang.Object configMsg,
java.lang.Class<? extends ItemDescriptor> clazz)
- This method does the mapping from a map of attributes contained it ITCMsg and the attributes of the descriptor.
NOTE: names of the attributes must be equal to the keys of the HashMap contained in ITCMsg.
- Parameters:
configMsg
-
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object