summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/StdoutAction.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/scape/StdoutAction.java')
-rw-r--r--NET/worlds/scape/StdoutAction.java143
1 files changed, 143 insertions, 0 deletions
diff --git a/NET/worlds/scape/StdoutAction.java b/NET/worlds/scape/StdoutAction.java
new file mode 100644
index 0000000..37a7f09
--- /dev/null
+++ b/NET/worlds/scape/StdoutAction.java
@@ -0,0 +1,143 @@
+/* */ package NET.worlds.scape;
+/* */
+/* */ import java.io.IOException;
+/* */ import java.io.PrintStream;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class StdoutAction
+/* */ extends Action
+/* */ {
+/* 25 */ String txt = null;
+/* 26 */ boolean dumpArg = false;
+/* */
+/* */
+/* */
+/* */
+/* */ public StdoutAction() {}
+/* */
+/* */
+/* */
+/* */ public StdoutAction(String text)
+/* */ {
+/* 37 */ this.txt = text;
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public Persister trigger(Event arg, Persister seqID)
+/* */ {
+/* 47 */ if (this.txt != null) {
+/* 48 */ System.out.println(this.txt);
+/* */ } else
+/* 50 */ System.out.println("StdoutAction " + getName() + ", no text!");
+/* 51 */ if (this.dumpArg)
+/* 52 */ if (arg == null) {
+/* 53 */ System.out.println("<Null event>");
+/* */ } else
+/* 55 */ System.out.println("<" + arg + ">");
+/* 56 */ System.out.flush();
+/* */
+/* 58 */ return null;
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public Object properties(int index, int offset, int mode, Object value)
+/* */ throws NoSuchPropertyException
+/* */ {
+/* 69 */ Object ret = null;
+/* 70 */ switch (index - offset) {
+/* */ case 0:
+/* 72 */ if (mode == 0) {
+/* 73 */ ret = StringPropertyEditor.make(new Property(this, index,
+/* 74 */ "Text Out"));
+/* 75 */ } else if (mode == 1) {
+/* 76 */ ret = this.txt;
+/* 77 */ } else if (mode == 2)
+/* 78 */ this.txt = ((String)value);
+/* 79 */ break;
+/* */ case 1:
+/* 81 */ if (mode == 0) {
+/* 82 */ ret = BooleanPropertyEditor.make(
+/* 83 */ new Property(this, index, "Dump Event"),
+/* 84 */ "Don't print event", "Print event");
+/* 85 */ } else if (mode == 1) {
+/* 86 */ ret = new Boolean(this.dumpArg);
+/* 87 */ } else if (mode == 2)
+/* 88 */ this.dumpArg = ((Boolean)value).booleanValue();
+/* 89 */ break;
+/* */ default:
+/* 91 */ ret = super.properties(index, offset + 2, mode, value);
+/* */ }
+/* 93 */ return ret;
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* 100 */ private static Object classCookie = new Object();
+/* */
+/* */ public void saveState(Saver s) throws IOException
+/* */ {
+/* 104 */ s.saveVersion(1, classCookie);
+/* 105 */ super.saveState(s);
+/* 106 */ s.saveString(this.txt);
+/* 107 */ s.saveBoolean(this.dumpArg);
+/* */ }
+/* */
+/* */ public void restoreState(Restorer r)
+/* */ throws IOException, TooNewException
+/* */ {
+/* 113 */ switch (r.restoreVersion(classCookie)) {
+/* */ case 0:
+/* 115 */ super.restoreState(r);
+/* 116 */ this.txt = r.restoreString();
+/* 117 */ r.setOldFlag();
+/* 118 */ break;
+/* */ case 1:
+/* 120 */ super.restoreState(r);
+/* 121 */ this.txt = r.restoreString();
+/* 122 */ this.dumpArg = r.restoreBoolean();
+/* 123 */ break;
+/* */ default:
+/* 125 */ throw new TooNewException();
+/* */ }
+/* */
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */ public String toString()
+/* */ {
+/* 135 */ return super.toString() + "[" + this.txt + "]";
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\StdoutAction.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file