cz.cuni.amis.pogamut.udk.agent.module.sensor
Class ItemDescriptors

Package class diagram package ItemDescriptors
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
      extended by cz.cuni.amis.pogamut.base.agent.module.SensorModule<UDKBot>
          extended by cz.cuni.amis.pogamut.udk.agent.module.sensor.ItemDescriptors
All Implemented Interfaces:
IComponent

public class ItemDescriptors
extends SensorModule<UDKBot>

Sensory module that provides mapping between ItemType and ItemDescriptor providing an easy way to obtain item descriptors for various items in UT2004.

Additionally it provides ammo->weapon mapping via getWeaponForAmmo(ItemType).

It is designed to be initialized inside IUDKBotController.prepareBot(UDKBot) method call and may be used since IUDKBotController#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage) is called.

Author:
Jimmy

Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensorModule
worldView
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
agent, controller, eventBus, log
 
Constructor Summary
ItemDescriptors(UDKBot bot)
          Constructor.
ItemDescriptors(UDKBot bot, LogCategory moduleLog)
           
 
Method Summary
 ItemDescriptor getDescriptor(ItemType itemType)
          Returns the descriptor for the given 'itemType'.
 ItemDescriptor getDescriptor(String inventoryType)
          Returns the descriptor for the given 'inventoryType'.
 ItemType getWeaponForAmmo(ItemType ammoType)
          Returns a weapon type for the given 'ammoType'.
 boolean hasDescriptor(ItemType itemType)
          Tells whether the descriptor for given 'itemType' exists.
 boolean hasDescriptor(String inventoryType)
          Tells whether the descriptor for given 'inventoryType' exists.
protected  void start(boolean startPaused)
          Provides initialization of the module (clearing internal data structures).
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
cleanUp, getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItemDescriptors

public ItemDescriptors(UDKBot bot)
Constructor. Setups the memory module based on bot's world view.

Parameters:
bot - owner of the module

ItemDescriptors

public ItemDescriptors(UDKBot bot,
                       LogCategory moduleLog)
Method Detail

getWeaponForAmmo

public ItemType getWeaponForAmmo(ItemType ammoType)
Returns a weapon type for the given 'ammoType'.

Parameters:
ammoType -
Returns:

hasDescriptor

public boolean hasDescriptor(ItemType itemType)
Tells whether the descriptor for given 'itemType' exists.

Parameters:
itemType -
Returns:
whether the descriptor for given 'itemType' exists

getDescriptor

public ItemDescriptor getDescriptor(ItemType itemType)
Returns the descriptor for the given 'itemType'.

Parameters:
itemType -
Returns:
descriptor for given 'itemType' exists

hasDescriptor

public boolean hasDescriptor(String inventoryType)
Tells whether the descriptor for given 'inventoryType' exists.

Parameters:
itemType -
Returns:
whether the descriptor for given 'inventoryType' exists

getDescriptor

public ItemDescriptor getDescriptor(String inventoryType)
Returns the descriptor for the given 'inventoryType'.

Parameters:
itemType -
Returns:
descriptor for given 'inventoryType' exists

start

protected void start(boolean startPaused)
Provides initialization of the module (clearing internal data structures). Called automatically during the agent starting sequence.

Overrides:
start in class AgentModule<UDKBot>


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