blob: 5f079830de85c7f6d8338f3dce126416e04b6a2a (
plain) (
blame)
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
|
/* */ package NET.worlds.scape;
/* */
/* */ import java.io.IOException;
/* */ import java.util.Vector;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class AddObjectAction
/* */ extends SetPropertyAction
/* */ {
/* */ private SuperRoot _value;
/* */
/* */ public Persister trigger(Event e, Persister seqID)
/* */ {
/* 27 */ assert (!useParam());
/* 28 */ add(this._value);
/* 29 */ return null;
/* */ }
/* */
/* */
/* */
/* */
/* */ public Object properties(int index, int offset, int mode, Object value)
/* */ throws NoSuchPropertyException
/* */ {
/* 38 */ Object ret = null;
/* 39 */ switch (index - offset) {
/* */ case 0:
/* 41 */ if (mode == 0) {
/* 42 */ VectorProperty vp = new VectorProperty(this, index,
/* 43 */ "Object to Add");
/* 44 */ if (this._value != null)
/* */ {
/* */
/* */
/* */
/* 49 */ vp.allowSetNull();
/* 50 */ ret = vp;
/* */ }
/* */ }
/* 53 */ else if (mode == 1) {
/* 54 */ ret = new Vector(1);
/* 55 */ if (this._value != null) {
/* 56 */ ((Vector)ret).addElement(this._value);
/* */ }
/* 58 */ } else if (mode == 4) {
/* 59 */ assert (value == this._value);
/* 60 */ this._value = null;
/* */ }
/* 62 */ else if (mode == 3) {
/* 63 */ assert (this._value == null);
/* 64 */ this._value = ((SuperRoot)value);
/* */ }
/* 66 */ break;
/* */ default:
/* 68 */ ret = super.properties(index, offset + 1, mode, value);
/* */ }
/* 70 */ return ret;
/* */ }
/* */
/* 73 */ private static Object classCookie = new Object();
/* */
/* */ public void saveState(Saver s) throws IOException
/* */ {
/* 77 */ s.saveVersion(1, classCookie);
/* 78 */ super.saveState(s);
/* 79 */ s.saveMaybeNull(this._value);
/* */ }
/* */
/* */ public void restoreState(Restorer r) throws IOException, TooNewException {
/* 83 */ switch (r.restoreVersion(classCookie)) {
/* */ case 1:
/* 85 */ super.restoreState(r);
/* 86 */ this._value = ((SuperRoot)r.restoreMaybeNull());
/* 87 */ break;
/* */
/* */ default:
/* 90 */ throw new TooNewException();
/* */ }
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\AddObjectAction.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|