summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/Event.java
blob: d02c75ea0a3ed60a0aff413244004dccc9de399f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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
 */