diff options
| author | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
| commit | e1e781bb2135ef78592226f1a3eaba4925702f1f (patch) | |
| tree | 8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/WaitAction.java | |
| download | worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip | |
Diffstat (limited to 'NET/worlds/scape/WaitAction.java')
| -rw-r--r-- | NET/worlds/scape/WaitAction.java | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/NET/worlds/scape/WaitAction.java b/NET/worlds/scape/WaitAction.java new file mode 100644 index 0000000..8bdf981 --- /dev/null +++ b/NET/worlds/scape/WaitAction.java @@ -0,0 +1,145 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import NET.worlds.core.Std; +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class WaitAction +/* */ extends Action +/* */ { +/* 30 */ float duration = 1.0F; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public WaitAction() {} +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public WaitAction(float duration) +/* */ { +/* 47 */ this.duration = duration; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public Persister trigger(Event evt, Persister seqID) +/* */ { +/* 56 */ long evttime = 0L; +/* 57 */ if (evt == null) { +/* 58 */ evttime = Std.getFastTime(); +/* */ } else +/* 60 */ evttime = evt.time; +/* 61 */ if (seqID == null) { +/* 62 */ seqID = new WaitActionState(evttime + (1000.0F * this.duration)); +/* */ } +/* 64 */ if (!((WaitActionState)seqID).run(evttime)) { +/* 65 */ seqID = null; +/* */ } +/* 67 */ return seqID; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public Object properties(int index, int offset, int mode, Object value) +/* */ throws NoSuchPropertyException +/* */ { +/* 77 */ Object ret = null; +/* 78 */ switch (index - offset) { +/* */ case 0: +/* 80 */ if (mode == 0) { +/* 81 */ ret = FloatPropertyEditor.make(new Property(this, index, +/* 82 */ "Duration (s)")); +/* 83 */ } else if (mode == 1) { +/* 84 */ ret = new Float(this.duration); +/* 85 */ } else if (mode == 2) +/* 86 */ this.duration = ((Float)value).floatValue(); +/* 87 */ break; +/* */ default: +/* 89 */ ret = super.properties(index, offset + 1, mode, value); +/* */ } +/* 91 */ return ret; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* 98 */ private static Object classCookie = new Object(); +/* */ +/* */ public void saveState(Saver s) throws IOException +/* */ { +/* 102 */ s.saveVersion(2, classCookie); +/* 103 */ super.saveState(s); +/* 104 */ s.saveFloat(this.duration); +/* */ } +/* */ +/* */ public void restoreState(Restorer r) +/* */ throws IOException, TooNewException +/* */ { +/* 110 */ switch (r.restoreVersion(classCookie)) { +/* */ case 0: +/* 112 */ r.setOldFlag(); +/* 113 */ super.restoreState(r); +/* 114 */ this.duration = r.restoreInt(); +/* 115 */ break; +/* */ case 1: +/* 117 */ r.setOldFlag(); +/* 118 */ super.restoreState(r); +/* 119 */ this.duration = r.restoreFloat(); +/* 120 */ r.restoreLong(); +/* 121 */ break; +/* */ case 2: +/* 123 */ super.restoreState(r); +/* 124 */ this.duration = r.restoreFloat(); +/* 125 */ break; +/* */ default: +/* 127 */ throw new TooNewException(); +/* */ } +/* */ +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public String toString() +/* */ { +/* 137 */ return super.toString() + "[" + this.duration + " s]"; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\WaitAction.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |