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