1 package nl.tudelft.goal.ut2004.messages;
2
3 import cz.cuni.amis.pogamut.base3d.worldview.object.Location;
4 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
5
6 public class UnrealIdOrLocation {
7
8
9 @Override
10 public String toString() {
11 return isLocation() ? location.toString() : id.toString();
12 }
13
14 private final UnrealId id;
15 private final Location location;
16
17 public UnrealIdOrLocation(Location location) {
18 super();
19 this.location = location;
20 this.id = null;
21 }
22
23 public UnrealIdOrLocation(UnrealId id) {
24 super();
25 this.location = null;
26 this.id = id;
27 }
28
29 public UnrealId getId() {
30 return id;
31 }
32
33 public Location getLocation() {
34 return location;
35 }
36
37 public boolean isUnrealId() {
38 return id != null;
39 }
40
41 public boolean isLocation() {
42 return location != null;
43 }
44
45 }