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 InteractedUsableObject
28 extends InfoMessage
29 implements IWorldEvent, IWorldChangeEvent
30
31 {
32
33
34 public static final String PROTOTYPE =
35 "IUO {Name text} {Location 0,0,0} {UOEvent 0} {Action text} ";
36
37
38
39
40
41
42 public InteractedUsableObject()
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
74
75
76
77
78
79
80
81
82
83
84
85 public InteractedUsableObject(
86 String Name, Location Location, int UOEvent, String Action
87 ) {
88
89 this.Name = Name;
90
91 this.Location = Location;
92
93 this.UOEvent = UOEvent;
94
95 this.Action = Action;
96
97 }
98
99
100
101
102
103
104 public InteractedUsableObject(InteractedUsableObject original) {
105
106 this.Name = original.getName()
107 ;
108
109 this.Location = original.getLocation()
110 ;
111
112 this.UOEvent = original.getUOEvent()
113 ;
114
115 this.Action = original.getAction()
116 ;
117
118 this.SimTime = original.getSimTime();
119 }
120
121
122 protected long SimTime;
123
124
125
126
127 @Override
128 public long getSimTime() {
129 return SimTime;
130 }
131
132
133
134
135 protected void setSimTime(long SimTime) {
136 this.SimTime = SimTime;
137 }
138
139
140
141
142
143
144
145 protected
146 String Name =
147 null;
148
149
150
151
152
153
154 public String getName()
155 {
156 return Name;
157 }
158
159
160
161
162
163
164
165 protected
166 Location Location =
167 null;
168
169
170
171
172
173
174 public Location getLocation()
175 {
176 return Location;
177 }
178
179
180
181
182
183
184
185 protected
186 int UOEvent =
187 0;
188
189
190
191
192
193
194 public int getUOEvent()
195 {
196 return UOEvent;
197 }
198
199
200
201
202
203
204
205 protected
206 String Action =
207 null;
208
209
210
211
212
213
214 public String getAction()
215 {
216 return Action;
217 }
218
219
220 public String toString() {
221 return
222 super.toString() + "[" +
223
224 "Name = " + String.valueOf(getName()
225 ) + " | " +
226
227 "Location = " + String.valueOf(getLocation()
228 ) + " | " +
229
230 "UOEvent = " + String.valueOf(getUOEvent()
231 ) + " | " +
232
233 "Action = " + String.valueOf(getAction()
234 ) + " | " +
235
236 "]";
237 }
238
239
240 public String toHtmlString() {
241 return super.toString() + "[<br/>" +
242
243 "<b>Name</b> = " + String.valueOf(getName()
244 ) + " <br/> " +
245
246 "<b>Location</b> = " + String.valueOf(getLocation()
247 ) + " <br/> " +
248
249 "<b>UOEvent</b> = " + String.valueOf(getUOEvent()
250 ) + " <br/> " +
251
252 "<b>Action</b> = " + String.valueOf(getAction()
253 ) + " <br/> " +
254
255 "<br/>]";
256 }
257
258 public String toJsonLiteral() {
259 return "interactedusableobject( "
260 +
261 (getName()
262 == null ? "null" :
263 "\"" + getName()
264 + "\""
265 )
266 + ", " +
267 (getLocation()
268 == null ? "null" :
269 "[" + getLocation()
270 .getX() + ", " + getLocation()
271 .getY() + ", " + getLocation()
272 .getZ() + "]"
273 )
274 + ", " +
275 String.valueOf(getUOEvent()
276 )
277 + ", " +
278 (getAction()
279 == null ? "null" :
280 "\"" + getAction()
281 + "\""
282 )
283
284 + ")";
285 }
286
287
288
289
290
291
292
293
294
295
296 }
297