blob: 5cfaca271406adb1fc30b3560fd9baa63ba0d01e (
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
131
132
133
134
135
136
137
138
139
140
141
142
|
/* */ 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<String, Drone> 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<Drone> e = this.zombies.elements();
/* 33 */ while (e.hasMoreElements()) {
/* 34 */ Drone id = (Drone)e.nextElement();
/* 35 */ Enumeration<WObject> 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<Object> rooms = Pilot.getActive().getRoom().getWorld().getRooms();
/* 86 */ while (rooms.hasMoreElements()) {
/* 87 */ Room r = (Room)rooms.nextElement();
/* 88 */ if (r != null)
/* */ {
/* */
/* 91 */ DeepEnumeration<Object> 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
*/
|