View Javadoc

1   package cz.cuni.amis.pogamut.multi.communication.worldview;
2   
3   import java.util.Map;
4   
5   import cz.cuni.amis.pogamut.base.communication.worldview.object.WorldObjectId;
6   import cz.cuni.amis.pogamut.base3d.worldview.object.IViewable;
7   
8   /**
9    * Interface that adds functionality related to visible objects to the worldView.
10   * @author srlok
11   *
12   */
13  public interface IVisionLocalWorldView extends ILocalWorldView{
14  
15  	/**
16  	 * Returns map of all visible objects ({@link IViewable} instances} - those that the agent can currently see.
17  	 * <p><p>
18  	 * <b>WARNING:</b> If you will do iteration over the map, you must synchronize on it.
19  	 */
20  	@SuppressWarnings("unchecked")
21  	public Map<Class, Map<WorldObjectId, IViewable>> getAllVisible();
22  	
23  	/**
24  	 * Returns map of all visible objects ({@link IViewable} instances} - those that the agent can currently see.
25   	 * <p><p>
26  	 * <b>WARNING:</b> If you will do iteration over the map, you must synchronize on it.
27  	 *
28  	 * @param type
29  	 * @return
30  	 */
31  	public <T extends IViewable> Map<WorldObjectId, T> getAllVisible(Class<T> type);
32  	
33  	/**
34  	 * Returns map of all visible objects ({@link IViewable} instances} organized according to their {@link WorldObjectId} - 
35  	 * those that the agent can currently see.
36  	 * <p><p>
37  	 * <b>WARNING:</b> If you will do iteration over the map, you must synchronize on it.
38  	 * @return
39  	 */
40  	public Map<WorldObjectId, IViewable> getVisible();
41  
42  	/**
43  	 * Returns a visible world object of the specific id (if exists inside the world view and is visible).<p>
44  	 * Otherwise, null is returned.
45  	 * 
46  	 * @param id objects's id
47  	 * @return
48  	 */
49  	public IViewable getVisible(WorldObjectId id);
50  }