/* */ package NET.worlds.console; /* */ /* */ import NET.worlds.network.URL; /* */ import NET.worlds.scape.DeepEnumeration; /* */ import NET.worlds.scape.Drone; /* */ import NET.worlds.scape.Pilot; /* */ import NET.worlds.scape.Point3Temp; /* */ import NET.worlds.scape.Room; /* */ import NET.worlds.scape.SuperRoot; /* */ import NET.worlds.scape.WObject; /* */ import NET.worlds.scape.World; /* */ import java.util.Enumeration; /* */ import java.util.Hashtable; /* */ /* */ /* */ /* */ class ArmyOfZombies /* */ { /* */ Hashtable zombies; /* 20 */ private static ArmyOfZombies instance = new ArmyOfZombies(); /* */ /* */ public static ArmyOfZombies instance() { /* 23 */ return instance; /* */ } /* */ /* */ protected ArmyOfZombies() { /* 27 */ this.zombies = new Hashtable(); /* */ } /* */ /* */ public void killZombies() /* */ { /* 32 */ Enumeration e = this.zombies.elements(); /* 33 */ while (e.hasMoreElements()) { /* 34 */ Drone id = (Drone)e.nextElement(); /* 35 */ Enumeration en = id.getContents(); /* 36 */ while (en.hasMoreElements()) { /* 37 */ WObject wob = (WObject)en.nextElement(); /* 38 */ wob.detach(); /* */ } /* 40 */ id.detach(); /* 41 */ id.discard(); /* */ } /* 43 */ this.zombies.clear(); /* */ } /* */ /* */ public void addZombie(Drone id) { /* 47 */ String name = id.getName(); /* 48 */ if (name.charAt(0) == '!') { /* 49 */ name = name.substring(1); /* */ } /* */ /* 52 */ this.zombies.put(name, id); /* */ } /* */ /* */ public void replaceZombie(String name, Drone id) { /* 56 */ Drone oldId = get(name); /* 57 */ if (oldId == id) /* 58 */ return; /* 59 */ this.zombies.remove(name); /* 60 */ addZombie(id); /* 61 */ id.makeTag(true); /* */ } /* */ /* */ public void killZombie(String name) { /* 65 */ Drone id = get(name); /* 66 */ if (id != null) { /* 67 */ this.zombies.remove(name); /* 68 */ id.detach(); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ public void zombify() /* */ { /* 78 */ if (Pilot.getActive() == null) /* 79 */ return; /* 80 */ if (Pilot.getActive().getRoom() == null) /* 81 */ return; /* 82 */ if (Pilot.getActive().getRoom().getWorld() == null) { /* 83 */ return; /* */ } /* 85 */ Enumeration rooms = Pilot.getActive().getRoom().getWorld().getRooms(); /* 86 */ while (rooms.hasMoreElements()) { /* 87 */ Room r = (Room)rooms.nextElement(); /* 88 */ if (r != null) /* */ { /* */ /* 91 */ DeepEnumeration de = new DeepEnumeration(); /* 92 */ r.getChildren(de); /* */ /* 94 */ while (de.hasMoreElements()) { /* 95 */ Object o = de.nextElement(); /* 96 */ if ((o instanceof Drone)) /* */ { /* */ /* 99 */ Drone d = (Drone)o; /* */ /* 101 */ Point3Temp pos = d.getPosition(); /* 102 */ short dir = (short)(int)(-d.getYaw() + 90.0F); /* 103 */ dir = (short)(dir % 360); /* 104 */ while (dir < 0) { /* 105 */ dir = (short)(dir + 360); /* */ } /* */ /* 108 */ SuperRoot wobj = d.getOwner(); /* 109 */ if (wobj != null) /* */ { /* 111 */ Room rm = wobj.getRoom(); /* 112 */ if (rm != null) /* */ { /* 114 */ if (d.getName() != null) /* */ { /* 116 */ BlackBox.getInstance().submitEvent( /* 117 */ new BBAppearDroneCommand(r.getRoom().toString(), d /* 118 */ .getName(), (short)(int)pos.x, (short)(int)pos.y, /* 119 */ (short)(int)pos.z, dir)); /* 120 */ if (d.getCurrentURL() != null) /* */ { /* 122 */ BlackBox.getInstance().submitEvent( /* 123 */ new BBDroneBitmapCommand(d.getName(), d.getCurrentURL() /* 124 */ .toString())); } /* */ } } /* */ } /* */ } /* */ } /* */ } } } /* */ /* 131 */ Drone get(String name) { if (name.charAt(0) == '!') { /* 132 */ name = name.substring(1); /* */ } /* 134 */ return (Drone)this.zombies.get(name); /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\ArmyOfZombies.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */