diff options
Diffstat (limited to 'NET/worlds/console/BBWObjClickedCommand.java')
| -rw-r--r-- | NET/worlds/console/BBWObjClickedCommand.java | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/NET/worlds/console/BBWObjClickedCommand.java b/NET/worlds/console/BBWObjClickedCommand.java new file mode 100644 index 0000000..7c925f5 --- /dev/null +++ b/NET/worlds/console/BBWObjClickedCommand.java @@ -0,0 +1,89 @@ +/* */ package NET.worlds.console; +/* */ +/* */ import NET.worlds.scape.DeepEnumeration; +/* */ import NET.worlds.scape.MouseDownEvent; +/* */ import NET.worlds.scape.MouseDownHandler; +/* */ import NET.worlds.scape.Pilot; +/* */ import NET.worlds.scape.Room; +/* */ import NET.worlds.scape.SuperRoot; +/* */ import java.io.DataInputStream; +/* */ import java.io.DataOutputStream; +/* */ import java.io.IOException; +/* */ +/* */ public class BBWObjClickedCommand extends BlackBoxCommand +/* */ { +/* */ private String objUrl; +/* */ int x; +/* */ int y; +/* */ char key; +/* */ +/* */ public BBWObjClickedCommand() +/* */ { +/* 22 */ this.commandType = 4; +/* */ } +/* */ +/* */ public BBWObjClickedCommand(String obj, char pkey, int px, int py) { +/* 26 */ this(); +/* 27 */ this.objUrl = new String(obj); +/* 28 */ this.key = pkey; +/* 29 */ this.x = px; +/* 30 */ this.y = py; +/* */ } +/* */ +/* */ public boolean execute() +/* */ { +/* 35 */ MouseDownHandler target = null; +/* 36 */ if (Pilot.getActive() == null) { +/* 37 */ return false; +/* */ } +/* 39 */ Room r = Pilot.getActive().getRoom(); +/* 40 */ if (r == null) { +/* 41 */ return false; +/* */ } +/* 43 */ DeepEnumeration<?> de = new DeepEnumeration(); +/* 44 */ r.getChildren(de); +/* 45 */ while (de.hasMoreElements()) { +/* 46 */ Object o = de.nextElement(); +/* 47 */ if (((o instanceof MouseDownHandler)) && +/* 48 */ (((SuperRoot)o).getName().equals(this.objUrl))) { +/* 49 */ target = (MouseDownHandler)o; +/* 50 */ break; +/* */ } +/* */ } +/* */ +/* */ +/* 55 */ if (target == null) { +/* 56 */ doCallback(false); +/* 57 */ return false; +/* */ } +/* */ +/* 60 */ MouseDownEvent e = new MouseDownEvent(0, null, this.key, this.x, this.y); +/* 61 */ target.handle(e); +/* 62 */ doCallback(true); +/* 63 */ return true; +/* */ } +/* */ +/* */ public void save(DataOutputStream dos) throws IOException +/* */ { +/* 68 */ super.save(dos); +/* 69 */ dos.writeInt(this.x); +/* 70 */ dos.writeInt(this.y); +/* 71 */ dos.writeChar(this.key); +/* 72 */ dos.writeUTF(this.objUrl); +/* */ } +/* */ +/* */ public void load(DataInputStream dis) throws IOException +/* */ { +/* 77 */ super.load(dis); +/* 78 */ this.x = dis.readInt(); +/* 79 */ this.y = dis.readInt(); +/* 80 */ this.key = dis.readChar(); +/* 81 */ this.objUrl = dis.readUTF(); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\BBWObjClickedCommand.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |