/* */ package NET.worlds.scape; /* */ /* */ import java.io.IOException; /* */ import java.io.PrintStream; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class SetPoint3Action /* */ extends SlidePropertyAction /* */ { /* 17 */ private Point3 _value = null; /* */ /* */ private Point3 _start; /* */ /* */ /* */ public Persister trigger(Event e, Persister seqID) /* */ { /* 24 */ Persister ret = null; /* 25 */ Point3 val = null; /* 26 */ if (useParam()) { /* 27 */ String p = param(); /* 28 */ if (p == null) { /* 29 */ this._value = null; /* */ } else { /* 31 */ float x = 0.0F;float y = 0.0F;float z = 0.0F; /* 32 */ boolean ok = true; /* 33 */ int comma = p.indexOf(','); /* 34 */ if (comma == -1) { /* 35 */ ok = false; /* */ } else { /* */ try { /* 38 */ x = Float.valueOf(p.substring(0, comma)).floatValue(); /* 39 */ p = p.substring(comma + 1); /* 40 */ comma = p.indexOf(','); /* 41 */ if (comma == -1) { /* 42 */ ok = false; /* */ } else { /* 44 */ y = /* 45 */ Float.valueOf(p.substring(0, comma)).floatValue(); /* 46 */ p = p.substring(comma + 1); /* 47 */ z = Float.valueOf(p).floatValue(); /* */ } /* */ } /* */ catch (NumberFormatException nfe) { /* 51 */ ok = false; /* */ } /* */ } /* 54 */ if (!ok) { /* 55 */ System.out.println(getName() + " unable to parse " + /* 56 */ paramName()); /* 57 */ x = 0.0F; /* 58 */ y = 0.0F; /* 59 */ z = 0.0F; /* */ } /* 61 */ this._value = new Point3(x, y, z); /* */ } /* */ } /* 64 */ if (this._value == null) { /* 65 */ if ((!$assertionsDisabled) && (slide())) throw new AssertionError(); /* */ } /* */ else { /* 68 */ if (slide()) { /* 69 */ if (seqID == null) { /* 70 */ start(); /* 71 */ this._start = ((Point3)get()); /* */ } /* 73 */ float frac = fraction(); /* 74 */ if (frac < 1.0D) { /* 75 */ val = new Point3(this._value); /* 76 */ val.x = ((this._value.x - this._start.x) * frac + this._start.x); /* 77 */ val.y = ((this._value.y - this._start.y) * frac + this._start.y); /* 78 */ val.z = ((this._value.z - this._start.z) * frac + this._start.z); /* 79 */ ret = this; /* */ } /* */ } /* 82 */ if (val == null) /* 83 */ val = this._value; /* */ } /* 85 */ set(val); /* 86 */ return ret; /* */ } /* */ /* */ public Object properties(int index, int offset, int mode, Object value) /* */ throws NoSuchPropertyException /* */ { /* 92 */ Object ret = null; /* 93 */ switch (index - offset) { /* */ case 0: /* 95 */ if (mode == 0) { /* 96 */ ret = Point3PropertyEditor.make(new Property(this, index, /* 97 */ "Set To").allowSetNull()); /* 98 */ if (this._value == null) { /* 99 */ ret = MaybeNullPropertyEditor.make((Property)ret, /* 100 */ new Point3()); /* */ } /* */ } /* 103 */ else if (mode == 1) { /* 104 */ ret = this._value; /* 105 */ } else if (mode == 2) { /* 106 */ this._value = ((Point3)value); /* 107 */ } else if (mode == 4) { /* 108 */ this._value = null; } /* 109 */ break; /* */ default: /* 111 */ ret = super.properties(index, offset + 1, mode, value); /* */ } /* 113 */ return ret; /* */ } /* */ /* 116 */ private static Object classCookie = new Object(); /* */ /* */ public void saveState(Saver s) throws IOException /* */ { /* 120 */ s.saveVersion(1, classCookie); /* 121 */ super.saveState(s); /* 122 */ s.saveMaybeNull(this._value); /* */ } /* */ /* */ public void restoreState(Restorer r) throws IOException, TooNewException /* */ { /* 127 */ switch (r.restoreVersion(classCookie)) { /* */ case 1: /* 129 */ super.restoreState(r); /* 130 */ this._value = ((Point3)r.restoreMaybeNull()); /* 131 */ break; /* */ /* */ default: /* 134 */ throw new TooNewException(); /* */ } /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\SetPoint3Action.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */