|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base3d.worldview.Vision
public class Vision
Vision is taking care about the objects the bot might see (of all implementing IViewable interface).
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface cz.cuni.amis.utils.listener.IListener |
---|
IListener.Notifier<LISTENER extends IListener> |
Constructor Summary | |
---|---|
Vision(IWorldView worldView,
IAgentLogger logger)
|
Method Summary | ||
---|---|---|
protected
|
addNewObjectCategory(java.lang.Class<T> cls)
Used to introduce new object category into worldObjects and immutableWorldObjects. |
|
protected void |
addSeeObject(IWorldObject seeObject)
Method that adds a new world object to the object maps. |
|
java.util.Map<java.lang.Class,java.util.Map<WorldObjectId,IWorldObject>> |
getSee()
Returns map of all objects the agent can currently see. |
|
|
getSee(java.lang.Class<T> type)
Returns map map of all objects of a certain type the agent can currently see. |
|
IWorldObject |
getSee(WorldObjectId id)
If agents sees item of 'id' it returns it instances, otherwise it returns null. |
|
protected IWorldObject |
getSeeObject(WorldObjectId objectId)
Returns world object of the given id or null if the object is not yet in the world view. |
|
void |
notify(IWorldObjectEvent<IViewable> event)
|
|
protected void |
removeSeeObject(IWorldObject worldObject)
Removes world object from the world view - this will be called from the descendants of the AbstractWorldView whenever world object should disappear from the world view. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Inject public Vision(IWorldView worldView, IAgentLogger logger)
Method Detail |
---|
public void notify(IWorldObjectEvent<IViewable> event)
notify
in interface IListener<IWorldObjectEvent<IViewable>>
protected <T> java.util.Map<WorldObjectId,T> addNewObjectCategory(java.lang.Class<T> cls)
It will create new synchronized Map<IWorldViewObjectId, T> in the worldObjects and it's immutable counterpart in immutableWorldObjects under key of 'cls'.
Returns modifiable version of created map.
T
- cls
-
protected void addSeeObject(IWorldObject seeObject)
worldObject
- protected IWorldObject getSeeObject(WorldObjectId objectId)
objectId
-
protected void removeSeeObject(IWorldObject worldObject)
worldObject
- public java.util.Map<java.lang.Class,java.util.Map<WorldObjectId,IWorldObject>> getSee()
WARNING: returns immutable map!
public <T> java.util.Map<WorldObjectId,T> getSee(java.lang.Class<T> type)
WARNING: returns immutable map!
type
-
public IWorldObject getSee(WorldObjectId id)
id
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |