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
|
/* */ package NET.worlds.scape;
/* */
/* */ import java.io.IOException;
/* */ import java.util.Enumeration;
/* */ import java.util.Vector;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class AdvancingAction
/* */ extends Action
/* */ {
/* 29 */ private Vector<Action> actions = new Vector();
/* */
/* */
/* 32 */ private int nextAction = 0;
/* */
/* */
/* 35 */ boolean singleTrigger = true;
/* 36 */ boolean inProgress = false;
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public Persister trigger(Event evt, Persister seqID)
/* */ {
/* 45 */ if ((this.singleTrigger) && (this.inProgress) && (seqID == null)) {
/* 46 */ return null;
/* */ }
/* */
/* 49 */ if (this.nextAction >= this.actions.size())
/* 50 */ this.nextAction = 0;
/* 51 */ Action act = (Action)this.actions.elementAt(this.nextAction);
/* */
/* */
/* 54 */ Persister id = null;
/* 55 */ if (act != null) {
/* 56 */ id = act.trigger(evt, seqID);
/* 57 */ this.inProgress = (id != null);
/* */ }
/* */
/* */
/* 61 */ if ((id == null) || (!this.singleTrigger)) {
/* 62 */ this.nextAction += 1;
/* */ }
/* 64 */ return id;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void addComponent(Action act)
/* */ {
/* 74 */ this.actions.addElement(act);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void insertComponent(Action act, int index)
/* */ {
/* 84 */ this.actions.insertElementAt(act, index);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean removeComponent(Action act)
/* */ {
/* 94 */ return this.actions.removeElement(act);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public Enumeration<Action> getComponents()
/* */ {
/* 103 */ return this.actions.elements();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public Object properties(int index, int offset, int mode, Object value)
/* */ throws NoSuchPropertyException
/* */ {
/* 114 */ Object ret = null;
/* 115 */ switch (index - offset) {
/* */ case 0:
/* 117 */ if (mode == 0) {
/* 118 */ VectorProperty vp =
/* 119 */ new VectorProperty(this, index, "Components");
/* 120 */ vp.allowSorting(false);
/* 121 */ ret = ObjectPropertyAdder.make(vp, getRoot(),
/* 122 */ "NET.worlds.scape.Action");
/* 123 */ } else if (mode == 1) {
/* 124 */ ret = this.actions.clone();
/* 125 */ } else if (mode == 4) {
/* 126 */ this.actions.removeElement(value);
/* 127 */ } else if (mode == 3) {
/* 128 */ this.actions.addElement((Action)value); }
/* 129 */ break;
/* */ case 1:
/* 131 */ if (mode == 0) {
/* 132 */ ret = BooleanPropertyEditor.make(new Property(this, index,
/* 133 */ "Prevent overlapping actions"),
/* 134 */ "Overlapping",
/* 135 */ "One at a time");
/* 136 */ } else if (mode == 1) {
/* 137 */ ret = new Boolean(this.singleTrigger);
/* 138 */ } else if (mode == 2)
/* 139 */ this.singleTrigger = ((Boolean)value).booleanValue();
/* 140 */ break;
/* */ default:
/* 142 */ ret = super.properties(index, offset + 2, mode, value);
/* */ }
/* 144 */ return ret;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* 151 */ private static Object classCookie = new Object();
/* */
/* */ public void saveState(Saver s) throws IOException
/* */ {
/* 155 */ s.saveVersion(1, classCookie);
/* 156 */ super.saveState(s);
/* 157 */ s.saveVector(this.actions);
/* 158 */ s.saveInt(this.nextAction);
/* 159 */ s.saveBoolean(this.singleTrigger);
/* */ }
/* */
/* */ public void restoreState(Restorer r) throws IOException, TooNewException
/* */ {
/* 164 */ switch (r.restoreVersion(classCookie)) {
/* */ case 0:
/* 166 */ super.restoreState(r);
/* 167 */ this.actions = r.restoreVectorActions();
/* 168 */ this.nextAction = r.restoreInt();
/* 169 */ break;
/* */ case 1:
/* 171 */ super.restoreState(r);
/* 172 */ this.actions = r.restoreVectorActions();
/* 173 */ this.nextAction = r.restoreInt();
/* 174 */ this.singleTrigger = r.restoreBoolean();
/* 175 */ break;
/* */ default:
/* 177 */ throw new TooNewException();
/* */ }
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\AdvancingAction.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|