summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/SetFloatAction.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/SetFloatAction.java
downloadworlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz
worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/scape/SetFloatAction.java')
-rw-r--r--NET/worlds/scape/SetFloatAction.java100
1 files changed, 100 insertions, 0 deletions
diff --git a/NET/worlds/scape/SetFloatAction.java b/NET/worlds/scape/SetFloatAction.java
new file mode 100644
index 0000000..5dbc088
--- /dev/null
+++ b/NET/worlds/scape/SetFloatAction.java
@@ -0,0 +1,100 @@
+/* */ package NET.worlds.scape;
+/* */
+/* */ import java.io.IOException;
+/* */ import java.io.PrintStream;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class SetFloatAction
+/* */ extends SlidePropertyAction
+/* */ {
+/* */ private float _value;
+/* */ private float _start;
+/* */
+/* */ public Persister trigger(Event e, Persister seqID)
+/* */ {
+/* 22 */ Persister ret = null;
+/* 23 */ if (useParam()) {
+/* */ try {
+/* 25 */ this._value = Float.valueOf(param()).floatValue();
+/* */ }
+/* */ catch (NumberFormatException nfe) {
+/* 28 */ System.out.println(getName() + " unable to parse " +
+/* 29 */ paramName());
+/* 30 */ this._value = 0.0F;
+/* */ }
+/* */ }
+/* 33 */ float val = this._value;
+/* 34 */ if (slide()) {
+/* 35 */ if (seqID == null) {
+/* 36 */ start();
+/* 37 */ this._start = ((Float)get()).floatValue();
+/* */ }
+/* 39 */ float frac = fraction();
+/* 40 */ if (frac < 1.0D) {
+/* 41 */ val = (this._value - this._start) * frac + this._start;
+/* 42 */ ret = this;
+/* */ }
+/* */ }
+/* 45 */ set(new Float(val));
+/* 46 */ return ret;
+/* */ }
+/* */
+/* */ public Object properties(int index, int offset, int mode, Object value)
+/* */ throws NoSuchPropertyException
+/* */ {
+/* 52 */ Object ret = null;
+/* 53 */ switch (index - offset) {
+/* */ case 0:
+/* 55 */ if (mode == 0) {
+/* 56 */ ret = FloatPropertyEditor.make(new Property(this, index,
+/* 57 */ "Set To"));
+/* 58 */ } else if (mode == 1) {
+/* 59 */ ret = new Float(this._value);
+/* 60 */ } else if (mode == 2)
+/* 61 */ this._value = ((Float)value).floatValue();
+/* 62 */ break;
+/* */ default:
+/* 64 */ ret = super.properties(index, offset + 1, mode, value);
+/* */ }
+/* 66 */ return ret;
+/* */ }
+/* */
+/* 69 */ private static Object classCookie = new Object();
+/* */
+/* */ public void saveState(Saver s) throws IOException
+/* */ {
+/* 73 */ s.saveVersion(2, classCookie);
+/* 74 */ super.saveState(s);
+/* 75 */ s.saveFloat(this._value);
+/* */ }
+/* */
+/* */ public void restoreState(Restorer r) throws IOException, TooNewException
+/* */ {
+/* 80 */ switch (r.restoreVersion(classCookie)) {
+/* */ case 2:
+/* 82 */ super.restoreState(r);
+/* 83 */ this._value = r.restoreFloat();
+/* 84 */ break;
+/* */ case 1:
+/* 86 */ setPropertyActionRestoreState(r);
+/* 87 */ this._value = r.restoreFloat();
+/* 88 */ break;
+/* */
+/* */ default:
+/* 91 */ throw new TooNewException();
+/* */ }
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\SetFloatAction.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file