cz.cuni.amis.pogamut.ut2004.communication.translator
Class TranslatorContext

java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.communication.translator.TranslatorContext

public class TranslatorContext
extends java.lang.Object

Translator context serves as the context during the FSM work. It provides respective fsm states an access to the instances of:

WARNING: the same context is used for Bot, ControlServer as well as Observer!


Constructor Summary
TranslatorContext(IWorldEventQueue events, ItemTranslator itemTranslator, java.util.logging.Logger log)
           
 
Method Summary
 IWorldEventQueue getEventQueue()
           
 java.util.Map<UnrealId,Item> getItems()
           
 ItemTranslator getItemTranslator()
           
 java.util.logging.Logger getLogger()
           
 java.util.Map<UnrealId,java.util.List<NavPointNeighbourLink>> getNavPointLinks()
           
 java.util.Map<UnrealId,NavPoint> getNavPoints()
           
 java.util.List<NavPointNeighbourLink> getNeighbours()
           
 void processNavPointLinks()
          Reads getNavPointsLinks() and alters navpoints incoming and outgoing edges.
 void processNavPointsAndItems()
          Interconnects instances of NavPoint and Item from getNavPoints() and getItems() map.
 void reset()
           
 void setItems(java.util.Map<UnrealId,Item> items)
           
 void setNavPointLinks(java.util.Map<UnrealId,java.util.List<NavPointNeighbourLink>> links)
           
 void setNavPoints(java.util.Map<UnrealId,NavPoint> navPoints)
           
 void setNeighbours(java.util.List<NavPointNeighbourLink> neighs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranslatorContext

public TranslatorContext(IWorldEventQueue events,
                         ItemTranslator itemTranslator,
                         java.util.logging.Logger log)
Method Detail

reset

public void reset()

getEventQueue

public IWorldEventQueue getEventQueue()

getItemTranslator

public ItemTranslator getItemTranslator()

getLogger

public java.util.logging.Logger getLogger()

getNeighbours

public java.util.List<NavPointNeighbourLink> getNeighbours()

setNeighbours

public void setNeighbours(java.util.List<NavPointNeighbourLink> neighs)

setNavPointLinks

public void setNavPointLinks(java.util.Map<UnrealId,java.util.List<NavPointNeighbourLink>> links)

getNavPointLinks

public java.util.Map<UnrealId,java.util.List<NavPointNeighbourLink>> getNavPointLinks()

setNavPoints

public void setNavPoints(java.util.Map<UnrealId,NavPoint> navPoints)

getNavPoints

public java.util.Map<UnrealId,NavPoint> getNavPoints()

setItems

public void setItems(java.util.Map<UnrealId,Item> items)

getItems

public java.util.Map<UnrealId,Item> getItems()

processNavPointLinks

public void processNavPointLinks()
Reads getNavPointsLinks() and alters navpoints incoming and outgoing edges.

Does nothing if getNavPoints() or getNavPointsLinks() returns null.


processNavPointsAndItems

public void processNavPointsAndItems()
Interconnects instances of NavPoint and Item from getNavPoints() and getItems() map.

Note that new instances of nav points are created during this process thus the getNavPoints() will return a new map after this method finishes.

Does nothing if getNavPoints() or getItems() returns null.