cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor
Class ItemDescriptor

Package class diagram package ItemDescriptor
java.lang.Object
  extended by cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.ItemDescriptor
Direct Known Subclasses:
AmmoDescriptor, ArmorDescriptor, GeneralDescriptor, HealthDescriptor, OtherDescriptor, ShieldDescriptor, WeaponDescriptor

public class ItemDescriptor
extends Object

A parent of all item descriptors. Contains attributes common for all descriptors plus some common functions.

Author:
Ondrej, knight

Constructor Summary
ItemDescriptor()
           
 
Method Summary
protected  void doReflexion(Object configMsg, Class<? extends ItemDescriptor> clazz)
          This method does the mapping from a map of attributes contained it ITCMsg and the attributes of the descriptor.
protected  String fieldToName(String string)
          Converts a fully qualified field name (e.g.
protected  String firstCharToUpperCase(String input)
           
 int getAmount()
           
 String getInventoryType()
           
 ItemType.Category getItemCategory()
           
 ItemType getPickupType()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItemDescriptor

public ItemDescriptor()
Method Detail

getAmount

public int getAmount()

getInventoryType

public String getInventoryType()

getPickupType

public ItemType getPickupType()

getItemCategory

public ItemType.Category getItemCategory()

fieldToName

protected String fieldToName(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 String firstCharToUpperCase(String input)

doReflexion

protected void doReflexion(Object configMsg,
                           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 String toString()
Overrides:
toString in class Object


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.