View Javadoc

1   package cz.cuni.amis.pogamut.udk.communication.translator.shared.events;
2   
3   import java.util.HashMap;
4   import java.util.Map;
5   
6   import cz.cuni.amis.pogamut.base.communication.translator.event.WorldEventIdentityWrapper;
7   import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
8   import cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.Item;
9   import cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.NavPoint;
10  
11  public class MapPointListObtained extends WorldEventIdentityWrapper {
12  
13  	// initialization of following fields is not neccessary but test Test01_WorldMessageTranslator depends on them
14  	private Map<UnrealId, NavPoint> navPoints;
15  	private Map<UnrealId, Item> items;
16  
17  	public MapPointListObtained(Map<UnrealId, NavPoint> navPoints, Map<UnrealId, Item> items) {
18  		this.navPoints = navPoints;
19  		this.items = items;		
20  	}
21  	
22  	public long getSimTime() {
23      	return 0;
24      }
25  	
26  	private MapPointListObtained readResolve() {
27  		if (navPoints == null) navPoints = new HashMap<UnrealId, NavPoint>();
28  		if (items == null) items = new HashMap<UnrealId, Item>();
29  		return this;
30  	}
31  
32  	public Map<UnrealId, NavPoint> getNavPoints() {
33  		return navPoints;
34  	}
35  	
36  	public Map<UnrealId, Item> getItems() {
37  		return items;
38  	}
39  
40  	public String toString() {
41  		return "MapPointListObtained[navPoints.size() = " + (navPoints == null ? "null" : navPoints.size()) + ", items.size() = "+ (items == null ? "null" : items.size()) +"]";
42  	}
43  
44  }