|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.ItemTranslator
public class ItemTranslator
Main class responsible for the item decoration.
Items in UT2004 has a lots of characteristics which don't change over the time (at least during one game). As it is pointless to send all those information every time an item is perceived by a bot, those information are sent through the ITCMsgs (ItemCategory). This message is used in ItemTranslator as a configuration message for an ItemDescriptor.
ItemDescriptor contains all characteristics available for the corresponding UTClass of items and is returned by the ItemTranslator. This description is then attached to the item (in fact to all item events like AIN, INV, IPK).
Now how does it work insight? ItemTranslator uses a set of DescriptorFactories (one for each type of an item). ITCMsg messages are usually sent at the beginning of the game (classes for all items in the map). But they can arrive in the middle of the game for a new category of an item. TODO: maybe it is rather ItemDecorator.
Constructor Summary | |
---|---|
ItemTranslator()
|
Method Summary | |
---|---|
void |
addCustomUserDescriptor(GeneralDescriptor userDescriptor)
Adds custom user descriptor. |
ItemDescriptor |
createDescriptor(ItemCategory message)
Default Pogamut descriptors will be created for all UT2004 items. |
ItemDescriptor |
getDefaultDescriptor(ItemType type)
Gets default Pogamut descriptor for this item. |
ItemDescriptor |
getDescriptor(ItemType type)
Gets descriptor for this item. |
ItemDescriptor |
getDescriptor(ItemTyped msg)
|
ItemType[] |
getItemTypes()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ItemTranslator()
Method Detail |
---|
public ItemType[] getItemTypes()
public ItemDescriptor getDescriptor(ItemTyped msg)
public ItemDescriptor getDescriptor(ItemType type)
type
-
public ItemDescriptor getDefaultDescriptor(ItemType type)
type
-
public void addCustomUserDescriptor(GeneralDescriptor userDescriptor)
userDescriptor
- public ItemDescriptor createDescriptor(ItemCategory message)
message
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |