blob: 347edfb29e9bc29288874fd4fd22762395b40e35 (
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
|
package NET.worlds.console;
import NET.worlds.scape.Drone;
import NET.worlds.scape.Pilot;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
public class BBAnimateDroneCommand extends BlackBoxCommand {
private String animation;
private String droneName;
public BBAnimateDroneCommand() {
this.commandType = 9;
}
public BBAnimateDroneCommand(String drone, String cmd) {
this();
this.animation = new String(cmd);
this.droneName = new String(drone);
}
@Override
public boolean execute() {
if (this.droneName.equals("@Pilot")) {
Pilot p = Pilot.getActive();
if (p != null) {
p.animate(this.animation);
}
} else {
Drone d = ArmyOfZombies.instance().get(this.droneName);
if (d != null) {
d.animate(this.animation);
}
}
this.doCallback(true);
return true;
}
@Override
public void save(DataOutputStream dos) throws IOException {
super.save(dos);
dos.writeUTF(this.animation);
dos.writeUTF(this.droneName);
}
@Override
public void load(DataInputStream dis) throws IOException {
super.load(dis);
this.animation = new String(dis.readUTF());
this.droneName = new String(dis.readUTF());
}
}
|