summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/SetPoint3Action.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/SetPoint3Action.java
downloadworlds.jar-main.tar.xz
worlds.jar-main.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/scape/SetPoint3Action.java')
-rw-r--r--NET/worlds/scape/SetPoint3Action.java143
1 files changed, 143 insertions, 0 deletions
diff --git a/NET/worlds/scape/SetPoint3Action.java b/NET/worlds/scape/SetPoint3Action.java
new file mode 100644
index 0000000..98830dc
--- /dev/null
+++ b/NET/worlds/scape/SetPoint3Action.java
@@ -0,0 +1,143 @@
+/* */ 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
+ */ \ No newline at end of file