1 package cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages;
2
3
4 import java.util.*;import javax.vecmath.*;import cz.cuni.amis.pogamut.base.communication.messages.*;import cz.cuni.amis.pogamut.base.communication.worldview.*;import cz.cuni.amis.pogamut.base.communication.worldview.event.*;import cz.cuni.amis.pogamut.base.communication.worldview.object.*;import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;import cz.cuni.amis.pogamut.base.communication.translator.event.*;import cz.cuni.amis.pogamut.multi.communication.translator.event.*;import cz.cuni.amis.pogamut.base3d.worldview.object.*;import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.*;import cz.cuni.amis.pogamut.ut2004.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType.Category;import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;import cz.cuni.amis.utils.exception.*;import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;import cz.cuni.amis.utils.SafeEquals;import cz.cuni.amis.pogamut.base.agent.*;import cz.cuni.amis.pogamut.multi.agent.*;import cz.cuni.amis.pogamut.multi.communication.worldview.property.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.property.*;import cz.cuni.amis.utils.token.*;import cz.cuni.amis.utils.*;
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 public class PickedUsableObject
28 extends InfoMessage
29 implements IWorldEvent, IWorldChangeEvent
30
31 {
32
33
34 public static final String PROTOTYPE =
35 "PUO {Name text} {Location 0,0,0} ";
36
37
38
39
40
41
42 public PickedUsableObject()
43 {
44 }
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73 public PickedUsableObject(
74 String Name, Location Location
75 ) {
76
77 this.Name = Name;
78
79 this.Location = Location;
80
81 }
82
83
84
85
86
87
88 public PickedUsableObject(PickedUsableObject original) {
89
90 this.Name = original.getName()
91 ;
92
93 this.Location = original.getLocation()
94 ;
95
96 this.SimTime = original.getSimTime();
97 }
98
99
100 protected long SimTime;
101
102
103
104
105 @Override
106 public long getSimTime() {
107 return SimTime;
108 }
109
110
111
112
113 protected void setSimTime(long SimTime) {
114 this.SimTime = SimTime;
115 }
116
117
118
119
120
121
122
123 protected
124 String Name =
125 null;
126
127
128
129
130
131
132 public String getName()
133 {
134 return Name;
135 }
136
137
138
139
140
141
142
143 protected
144 Location Location =
145 null;
146
147
148
149
150
151
152 public Location getLocation()
153 {
154 return Location;
155 }
156
157
158 public String toString() {
159 return
160 super.toString() + "[" +
161
162 "Name = " + String.valueOf(getName()
163 ) + " | " +
164
165 "Location = " + String.valueOf(getLocation()
166 ) + " | " +
167
168 "]";
169 }
170
171
172 public String toHtmlString() {
173 return super.toString() + "[<br/>" +
174
175 "<b>Name</b> = " + String.valueOf(getName()
176 ) + " <br/> " +
177
178 "<b>Location</b> = " + String.valueOf(getLocation()
179 ) + " <br/> " +
180
181 "<br/>]";
182 }
183
184 public String toJsonLiteral() {
185 return "pickedusableobject( "
186 +
187 (getName()
188 == null ? "null" :
189 "\"" + getName()
190 + "\""
191 )
192 + ", " +
193 (getLocation()
194 == null ? "null" :
195 "[" + getLocation()
196 .getX() + ", " + getLocation()
197 .getY() + ", " + getLocation()
198 .getZ() + "]"
199 )
200
201 + ")";
202 }
203
204
205
206
207
208
209
210
211
212
213 }
214