1
2
3
4
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
32
33
34
35
36
37
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
|
/* */ package NET.worlds.scape;
/* */
/* */ import java.io.DataInputStream;
/* */ import java.io.DataOutputStream;
/* */ import java.io.IOException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class TransAttribute
/* */ extends Attribute
/* */ {
/* */ private Point3 defPos;
/* */ private Point3 defRAxis;
/* */ private float defRotation;
/* */ private Point3 defScale;
/* */
/* */ public TransAttribute(int attrID)
/* */ {
/* 42 */ super(attrID);
/* */ }
/* */
/* */
/* */ public TransAttribute() {}
/* */
/* */
/* */ protected void noteAddingTo(SuperRoot owner)
/* */ {
/* 51 */ WObject w = (WObject)((Sharer)owner).getOwner();
/* */
/* 53 */ w._transformAttribute = this;
/* */
/* */
/* */
/* 57 */ initDefault();
/* */ }
/* */
/* */ public void detach()
/* */ {
/* 62 */ WObject w = (WObject)((Sharer)getOwner()).getOwner();
/* 63 */ w._transformAttribute = null;
/* 64 */ super.detach();
/* */ }
/* */
/* */
/* */
/* */
/* */ public void noteChange()
/* */ {
/* 72 */ if (TCompressor.dontSend)
/* 73 */ return;
/* 74 */ super.noteChange();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void generateNetData(DataOutputStream s)
/* */ throws IOException
/* */ {
/* 88 */ WObject w = (WObject)getOwner().getOwner();
/* */
/* */
/* */
/* */
/* 93 */ if (this._shorthandVersion == 0)
/* */ {
/* 95 */ Point3Temp pos = w.getPosition();
/* 96 */ s.writeFloat(pos.x);
/* 97 */ s.writeFloat(pos.y);
/* 98 */ s.writeFloat(pos.z);
/* 99 */ Point3Temp scale = w.getScale();
/* 100 */ s.writeFloat(scale.x);
/* 101 */ s.writeFloat(scale.y);
/* 102 */ s.writeFloat(scale.z);
/* 103 */ return;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* 110 */ initDefault();
/* */
/* 112 */ TCompressor.compress(w, this.defPos, this.defRAxis, this.defRotation, this.defScale,
/* 113 */ this._sharingMode, s);
/* */ }
/* */
/* */ private void initDefault()
/* */ {
/* 118 */ if (this.defPos == null)
/* */ {
/* 120 */ WObject w = (WObject)((Sharer)getOwner()).getOwner();
/* */
/* 122 */ this.defPos = new Point3(w.getPosition());
/* 123 */ this.defRAxis = new Point3();
/* 124 */ this.defRotation = w.getSpin(this.defRAxis);
/* 125 */ this.defScale = new Point3(w.getScale());
/* */ }
/* */ }
/* */
/* */ public void setFromNetData(DataInputStream ds, int len) throws IOException
/* */ {
/* 131 */ WObject w = (WObject)getOwner().getOwner();
/* */
/* */
/* */
/* */
/* */
/* 137 */ initDefault();
/* */
/* */
/* */
/* */
/* */ try
/* */ {
/* 144 */ TCompressor.decompress(w, this.defPos, this.defRAxis, this.defRotation, this.defScale,
/* 145 */ this._sharingMode, len, ds);
/* */ }
/* */ catch (IOException e)
/* */ {
/* 149 */ TCompressor.dontSend = false;
/* 150 */ throw e;
/* */ }
/* */ }
/* */
/* */
/* 155 */ private int _sharingMode = 57344;
/* */
/* */ public boolean getSharingPosition() {
/* 158 */ return (this._sharingMode & 0x8000) != 0;
/* */ }
/* */
/* */ public void setSharingPosition(boolean b) {
/* 162 */ if (b) {
/* 163 */ this._sharingMode |= 0x8000;
/* */ } else {
/* 165 */ this._sharingMode &= 0xFFFF7FFF;
/* */ }
/* */ }
/* */
/* */ public boolean getSharingRotation() {
/* 170 */ return (this._sharingMode & 0x4000) != 0;
/* */ }
/* */
/* */ public void setSharingRotation(boolean b)
/* */ {
/* 175 */ if (b) {
/* 176 */ this._sharingMode |= 0x4000;
/* */ } else {
/* 178 */ this._sharingMode &= 0xBFFF;
/* */ }
/* */ }
/* */
/* */ public boolean getSharingScale() {
/* 183 */ return (this._sharingMode & 0x2000) != 0;
/* */ }
/* */
/* */ public void setSharingScale(boolean b)
/* */ {
/* 188 */ if (b) {
/* 189 */ this._sharingMode |= 0x2000;
/* */ } else {
/* 191 */ this._sharingMode &= 0xDFFF;
/* */ }
/* */ }
/* */
/* */
/* */ public Object properties(int index, int offset, int mode, Object value)
/* */ throws NoSuchPropertyException
/* */ {
/* 199 */ Object ret = null;
/* */
/* 201 */ switch (index - offset) {
/* */ case 0:
/* 203 */ if (mode == 0) {
/* 204 */ ret = BooleanPropertyEditor.make(
/* 205 */ new Property(this, index, "Share Position"), "No", "Yes");
/* 206 */ } else if (mode == 1) {
/* 207 */ ret = new Boolean(getSharingPosition());
/* 208 */ } else if (mode == 2)
/* 209 */ setSharingPosition(((Boolean)value).booleanValue());
/* 210 */ break;
/* */ case 1:
/* 212 */ if (mode == 0) {
/* 213 */ ret = BooleanPropertyEditor.make(
/* 214 */ new Property(this, index, "Share Rotation"), "No", "Yes");
/* 215 */ } else if (mode == 1) {
/* 216 */ ret = new Boolean(getSharingRotation());
/* 217 */ } else if (mode == 2)
/* 218 */ setSharingRotation(((Boolean)value).booleanValue());
/* 219 */ break;
/* */ case 2:
/* 221 */ if (mode == 0) {
/* 222 */ ret = BooleanPropertyEditor.make(
/* 223 */ new Property(this, index, "Share Scale"),
/* 224 */ "No", "Yes");
/* 225 */ } else if (mode == 1) {
/* 226 */ ret = new Boolean(getSharingScale());
/* 227 */ } else if (mode == 2)
/* 228 */ setSharingScale(((Boolean)value).booleanValue());
/* 229 */ break;
/* */
/* */ default:
/* 232 */ ret = super.properties(index, offset + 3, mode, value);
/* */ }
/* 234 */ return ret;
/* */ }
/* */
/* */
/* */
/* 239 */ private static Object classCookie = new Object();
/* */
/* */ public void saveState(Saver s) throws IOException
/* */ {
/* 243 */ s.saveVersion(2, classCookie);
/* 244 */ super.saveState(s);
/* */
/* */
/* */
/* 248 */ initDefault();
/* */
/* 250 */ s.saveInt(this._sharingMode);
/* 251 */ s.saveFloat(this.defPos.x);
/* 252 */ s.saveFloat(this.defPos.y);
/* 253 */ s.saveFloat(this.defPos.z);
/* 254 */ s.saveFloat(this.defRAxis.x);
/* 255 */ s.saveFloat(this.defRAxis.y);
/* 256 */ s.saveFloat(this.defRAxis.z);
/* 257 */ s.saveFloat(this.defRotation);
/* 258 */ s.saveFloat(this.defScale.x);
/* 259 */ s.saveFloat(this.defScale.y);
/* 260 */ s.saveFloat(this.defScale.z);
/* */ }
/* */
/* */ public void restoreState(Restorer r) throws IOException, TooNewException
/* */ {
/* 265 */ int vers = r.restoreVersion(classCookie);
/* 266 */ switch (vers) {
/* */ case 0:
/* 268 */ super.restoreState(r);
/* 269 */ break;
/* */ case 1:
/* */ case 2:
/* 272 */ this.defPos = new Point3();
/* 273 */ this.defRAxis = new Point3();
/* 274 */ this.defScale = new Point3();
/* */
/* 276 */ super.restoreState(r);
/* 277 */ this._sharingMode = r.restoreInt();
/* 278 */ this.defPos.x = r.restoreFloat();
/* 279 */ this.defPos.y = r.restoreFloat();
/* 280 */ this.defPos.z = r.restoreFloat();
/* 281 */ this.defRAxis.x = r.restoreFloat();
/* 282 */ this.defRAxis.y = r.restoreFloat();
/* 283 */ this.defRAxis.z = r.restoreFloat();
/* 284 */ this.defRotation = r.restoreFloat();
/* 285 */ this.defScale.x = r.restoreFloat();
/* 286 */ this.defScale.y = r.restoreFloat();
/* 287 */ this.defScale.z = r.restoreFloat();
/* */
/* 289 */ break;
/* */ default:
/* 291 */ throw new TooNewException();
/* */ }
/* */
/* 294 */ if (vers < 2)
/* 295 */ this._shorthandVersion = vers;
/* */ }
/* */
/* 298 */ public int getMaxShorthandVersion() { return 1; }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\TransAttribute.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|