1
2 /**
3 IMPORTANT !!!
4
5 DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbinfomessages BY
6 THE JavaClassesGenerator.xslt. MODIFY THESE FILES INSTEAD OF THIS ONE.
7
8 IMPORTANT END !!!
9 */
10 package
11 cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages;
12 import java.util.*;
13 import javax.vecmath.*;
14 import cz.cuni.amis.pogamut.base.communication.messages.*;
15 import cz.cuni.amis.pogamut.base.communication.worldview.*;
16 import cz.cuni.amis.pogamut.base.communication.worldview.event.*;
17 import cz.cuni.amis.pogamut.base.communication.worldview.object.*;
18 import cz.cuni.amis.pogamut.base.communication.translator.event.*;
19 import cz.cuni.amis.pogamut.base3d.worldview.object.*;
20 import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;
21 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
22 import cz.cuni.amis.pogamut.udk.communication.messages.*;
23 import cz.cuni.amis.pogamut.udk.communication.worldview.objects.*;
24 import cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.*;
25 import cz.cuni.amis.pogamut.udk.communication.messages.ItemType.Category;
26 import cz.cuni.amis.utils.exception.*;
27 import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;
28 import cz.cuni.amis.utils.SafeEquals;
29 import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;
30
31
32 /**
33
34 Asynchronous message. Maybe another player walking or shooting,
35 maybe a bullet hitting the floor or just a nearby lift going up
36 or down.
37
38 Corresponding GameBots message is
39 HRN.
40
41 */
42
43 public class
44 HearNoise
45 extends GBEvent
46
47 implements IWorldEvent, IWorldChangeEvent
48
49 {
50
51 /**
52 Creates new instance of command HearNoise.
53
54 Asynchronous message. Maybe another player walking or shooting,
55 maybe a bullet hitting the floor or just a nearby lift going up
56 or down.
57 Corresponding GameBots message for this command is
58 .
59 @param Source
60 Unique ID of actor making the noise - may be other player or
61 some other object in the game.
62
63 @param Type
64 What class this actor is - item, projectile, player...
65
66 @param Rotation
67 How should bot rotate if it would like to be in the
68 direction of the "noisy" actor.
69
70 */
71 public HearNoise(
72 UnrealId Source, String Type, Rotation Rotation) {
73
74 this.Source = Source;
75
76 this.Type = Type;
77
78 this.Rotation = Rotation;
79
80 }
81
82
83 /** Example how the message looks like - used during parser tests. */
84 public static final String PROTOTYPE =
85 "HRN {Source unreal_id} {Type text} {Rotation 0,0,0}";
86
87
88 /////// Properties BEGIN
89
90 /**
91
92 Unique ID of actor making the noise - may be other player or
93 some other object in the game.
94 */
95 protected
96 UnrealId Source =
97 null;
98
99
100 /**
101
102 Unique ID of actor making the noise - may be other player or
103 some other object in the game.
104 */
105 public
106 UnrealId getSource() {
107 return
108 Source;
109 }
110
111
112
113 /**
114
115 What class this actor is - item, projectile, player...
116 */
117 protected
118 String Type =
119 null;
120
121
122 /**
123
124 What class this actor is - item, projectile, player...
125 */
126 public
127 String getType() {
128 return
129 Type;
130 }
131
132
133
134 /**
135
136 How should bot rotate if it would like to be in the
137 direction of the "noisy" actor.
138 */
139 protected
140 Rotation Rotation =
141 null;
142
143
144 /**
145
146 How should bot rotate if it would like to be in the
147 direction of the "noisy" actor.
148 */
149 public
150 Rotation getRotation() {
151 return
152 Rotation;
153 }
154
155
156
157 /////// Properties END
158
159 /////// Extra Java code BEGIN
160
161 /////// Additional code from xslt BEGIN
162
163 public long getSimTime() {
164 // NOT IMPLEMENTED FOR UDK
165 return 0;
166 }
167
168
169
170 /////// Additional code from xslt END
171
172 /////// Extra Java from XML BEGIN
173
174 /////// Extra Java from XML END
175
176 /////// Extra Java code END
177
178
179
180 /**
181 * Cloning constructor.
182 */
183 public HearNoise(HearNoise original) {
184
185 this.Source=original.Source;
186
187 this.Type=original.Type;
188
189 this.Rotation=original.Rotation;
190
191 }
192
193
194 /**
195 * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
196 */
197 public HearNoise() {
198 }
199
200
201
202 public String toString() {
203 return
204
205 super.toString() + " | " +
206
207 "Source = " +
208 String.valueOf(Source) + " | " +
209
210 "Type = " +
211 String.valueOf(Type) + " | " +
212
213 "Rotation = " +
214 String.valueOf(Rotation) + " | " +
215 "";
216
217 }
218
219 public String toHtmlString() {
220 return super.toString() +
221
222 "<b>Source</b> : " +
223 String.valueOf(Source) +
224 " <br/> " +
225
226 "<b>Type</b> : " +
227 String.valueOf(Type) +
228 " <br/> " +
229
230 "<b>Rotation</b> : " +
231 String.valueOf(Rotation) +
232 " <br/> " +
233 "";
234 }
235
236
237
238 }
239
240