summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/Event.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/scape/Event.java')
-rw-r--r--NET/worlds/scape/Event.java130
1 files changed, 130 insertions, 0 deletions
diff --git a/NET/worlds/scape/Event.java b/NET/worlds/scape/Event.java
new file mode 100644
index 0000000..d02c75e
--- /dev/null
+++ b/NET/worlds/scape/Event.java
@@ -0,0 +1,130 @@
+/* */ package NET.worlds.scape;
+/* */
+/* */ import java.io.PrintStream;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class Event
+/* */ implements Cloneable
+/* */ {
+/* */ public Event(int time, Object source, WObject target)
+/* */ {
+/* 25 */ this.time = time;
+/* 26 */ this.source = source;
+/* 27 */ this.target = target;
+/* */ }
+/* */
+/* 30 */ public static final Class<? extends Object> eventSuperclass = new Object().getClass();
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public int time;
+/* */
+/* */
+/* */
+/* */
+/* */ public Object source;
+/* */
+/* */
+/* */
+/* */
+/* */ public WObject target;
+/* */
+/* */
+/* */
+/* */
+/* */ public WObject receiver;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public Object clone()
+/* */ {
+/* */ try
+/* */ {
+/* 61 */ return super.clone();
+/* */ } catch (CloneNotSupportedException e) {
+/* 63 */ System.out.println("Clone of Object not supported!"); }
+/* 64 */ return null;
+/* */ }
+/* */
+/* */
+/* */
+/* */ public boolean isA(Class<?> c)
+/* */ {
+/* 71 */ for (Class<?> t = getClass();
+/* 72 */ t != eventSuperclass;
+/* 73 */ t = t.getSuperclass())
+/* */ {
+/* 75 */ if (t == c) {
+/* 76 */ return true;
+/* */ }
+/* */ }
+/* 79 */ return false;
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public boolean deliver(Object o)
+/* */ {
+/* 91 */ if (((o instanceof Handler)) &&
+/* 92 */ (((Handler)o).handle(this))) {
+/* 93 */ return true;
+/* */ }
+/* */
+/* */
+/* */
+/* 98 */ return false;
+/* */ }
+/* */
+/* */ public String toString()
+/* */ {
+/* 103 */ String result = "Event at " + this.time;
+/* */
+/* 105 */ String sname = null;
+/* 106 */ if ((this.source instanceof SuperRoot)) {
+/* 107 */ sname = ((SuperRoot)this.source).getName();
+/* 108 */ } else if (this.source != null)
+/* 109 */ sname = this.source.toString();
+/* 110 */ if (sname != null)
+/* 111 */ result = result + " from " + sname;
+/* 112 */ String tname = null;
+/* 113 */ if (this.target != null)
+/* 114 */ tname = this.target.getName();
+/* 115 */ if (tname != null)
+/* 116 */ result = result + " to " + tname;
+/* 117 */ String rname = null;
+/* 118 */ if (this.receiver != null)
+/* 119 */ rname = this.receiver.getName();
+/* 120 */ if (rname != null)
+/* 121 */ result = result + " handled by " + rname;
+/* 122 */ return result;
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\Event.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file