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 IncomingProjectileStaticImpl
28 extends
29 IncomingProjectileStatic
30 {
31
32
33
34
35
36
37 public IncomingProjectileStaticImpl()
38 {
39 }
40
41
42
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 public IncomingProjectileStaticImpl(
79 UnrealId Id
80 ) {
81
82 this.Id = Id;
83
84 }
85
86
87
88
89
90
91 public IncomingProjectileStaticImpl(IncomingProjectile original) {
92
93 this.Id = original.getId()
94 ;
95
96 this.SimTime = original.getSimTime();
97 }
98
99
100
101
102
103
104 public IncomingProjectileStaticImpl(IncomingProjectileStaticImpl original) {
105
106 this.Id = original.getId()
107 ;
108
109 this.SimTime = original.getSimTime();
110 }
111
112
113
114
115
116
117 public IncomingProjectileStaticImpl(IncomingProjectileStatic original) {
118
119 this.Id = original.getId()
120 ;
121
122 }
123
124
125 @Override
126 public void setSimTime(long SimTime) {
127 super.setSimTime(SimTime);
128 }
129
130 @Override
131 public
132 IncomingProjectileStaticImpl clone() {
133 return new
134 IncomingProjectileStaticImpl(this);
135 }
136
137
138
139
140
141
142 protected
143 UnrealId Id =
144 null;
145
146
147
148
149 public UnrealId getId()
150 {
151 return Id;
152 }
153
154
155
156 public static class IncomingProjectileStaticUpdate
157 implements IStaticWorldObjectUpdatedEvent
158 {
159
160 private IncomingProjectileStatic data;
161 private long time;
162
163 public IncomingProjectileStaticUpdate
164 (IncomingProjectileStatic source, long time)
165 {
166 this.data = source;
167 this.time = time;
168 }
169
170
171
172
173 @Override
174 public long getSimTime() {
175 return time;
176 }
177
178 @Override
179 public WorldObjectId getId() {
180 return data.getId();
181 }
182
183 @Override
184 public IWorldObjectUpdateResult<IStaticWorldObject> update(
185 IStaticWorldObject object) {
186 if ( object == null)
187 {
188 data = new IncomingProjectileStaticImpl(data);
189 return new IWorldObjectUpdateResult.WorldObjectUpdateResult<IStaticWorldObject>(IWorldObjectUpdateResult.Result.CREATED, data);
190 }
191
192 if ( object instanceof IncomingProjectileStaticImpl)
193 {
194 IncomingProjectileStaticImpl orig = (IncomingProjectileStaticImpl)object;
195
196 if ( data.isDifferentFrom(orig) )
197 {
198
199
200 System.out.println("!!!!!ERROR!!!!!! in static object modification. Object class : IncomingProjectileStaticImpl to see which property was different see !!!!PROPERTY UPDATE ERROR!!!!");
201 }
202 return new IWorldObjectUpdateResult.WorldObjectUpdateResult<IStaticWorldObject>(IWorldObjectUpdateResult.Result.SAME, data);
203 }
204 throw new PogamutException("Unexpected object type for update, IncomingProjectileStaticImpl expected not class " + object.getClass().getSimpleName() + ".", this);
205 }
206 }
207
208
209
210 @Override
211 public boolean isDifferentFrom(IStaticWorldObject other)
212 {
213 if (other == null)
214 {
215 return true;
216 }
217 else if (other == this)
218 {
219 return false;
220 }
221 else
222 {
223 IncomingProjectileStatic obj = (IncomingProjectileStatic) other;
224
225
226 if ( !(
227 AdvancedEquals.equalsOrNull(this.getId()
228 , obj.getId()
229 )
230 ) )
231 {
232 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property Id on object class IncomingProjectileStatic");
233 return true;
234 }
235
236 }
237 return false;
238 }
239
240
241 public String toString() {
242 return
243 super.toString() + "[" +
244
245 "Id = " + String.valueOf(getId()
246 ) + " | " +
247
248 "]";
249 }
250
251
252 public String toHtmlString() {
253 return super.toString() + "[<br/>" +
254
255 "<b>Id</b> = " + String.valueOf(getId()
256 ) + " <br/> " +
257
258 "<br/>]";
259 }
260
261
262
263
264
265
266
267
268
269
270 }
271