summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/RemoveObjectAction.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/RemoveObjectAction.java
downloadworlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz
worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/scape/RemoveObjectAction.java')
-rw-r--r--NET/worlds/scape/RemoveObjectAction.java91
1 files changed, 91 insertions, 0 deletions
diff --git a/NET/worlds/scape/RemoveObjectAction.java b/NET/worlds/scape/RemoveObjectAction.java
new file mode 100644
index 0000000..a19f80b
--- /dev/null
+++ b/NET/worlds/scape/RemoveObjectAction.java
@@ -0,0 +1,91 @@
+/* */ package NET.worlds.scape;
+/* */
+/* */ import java.io.IOException;
+/* */ import java.util.Vector;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class RemoveObjectAction
+/* */ extends SetPropertyAction
+/* */ {
+/* */ private SuperRoot _value;
+/* */
+/* */ public Persister trigger(Event e, Persister seqID)
+/* */ {
+/* 24 */ assert (!useParam());
+/* 25 */ remove(this._value);
+/* 26 */ return null;
+/* */ }
+/* */
+/* */ public Object properties(int index, int offset, int mode, Object value)
+/* */ throws NoSuchPropertyException
+/* */ {
+/* 32 */ Object ret = null;
+/* 33 */ switch (index - offset) {
+/* */ case 0:
+/* 35 */ if (mode == 0) {
+/* 36 */ VectorProperty vp = new VectorProperty(this, index, "Object to Remove");
+/* 37 */ SuperRoot target = getTarget();
+/* 38 */ if ((this._value == null) && (target != null))
+/* */ {
+/* */
+/* 41 */ ret = ObjectPropertyAdder.make(vp, target, "NET.worlds.scape.SuperRoot");
+/* */ } else {
+/* 43 */ vp.allowSetNull();
+/* 44 */ ret = vp;
+/* */ }
+/* 46 */ } else if (mode == 1) {
+/* 47 */ Vector<Object> vret = new Vector(1);
+/* 48 */ if (this._value != null) {
+/* 49 */ vret.addElement(this._value);
+/* */ }
+/* 51 */ ret = vret;
+/* 52 */ } else if (mode == 4) {
+/* 53 */ assert (value == this._value);
+/* 54 */ this._value = null;
+/* 55 */ } else if (mode == 3) {
+/* 56 */ assert (this._value == null);
+/* 57 */ this._value = ((SuperRoot)value);
+/* */ }
+/* 59 */ break;
+/* */ default:
+/* 61 */ ret = super.properties(index, offset + 1, mode, value);
+/* */ }
+/* 63 */ return ret;
+/* */ }
+/* */
+/* 66 */ private static Object classCookie = new Object();
+/* */
+/* */ public void saveState(Saver s) throws IOException {
+/* 69 */ s.saveVersion(1, classCookie);
+/* 70 */ super.saveState(s);
+/* 71 */ s.saveMaybeNull(this._value);
+/* */ }
+/* */
+/* */ public void restoreState(Restorer r) throws IOException, TooNewException {
+/* 75 */ switch (r.restoreVersion(classCookie)) {
+/* */ case 1:
+/* 77 */ super.restoreState(r);
+/* 78 */ this._value = ((SuperRoot)r.restoreMaybeNull());
+/* 79 */ break;
+/* */
+/* */ default:
+/* 82 */ throw new TooNewException();
+/* */ }
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\RemoveObjectAction.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file