summaryrefslogtreecommitdiff
path: root/NET/worlds/console/BBAnimateDroneCommand.java
blob: 20b95d0dd6c43dc89288cc8605d8594f1354b7e1 (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
/*    */ 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()
/*    */   {
/* 16 */     this.commandType = 9;
/*    */   }
/*    */   
/*    */   public BBAnimateDroneCommand(String drone, String cmd) {
/* 20 */     this();
/* 21 */     this.animation = new String(cmd);
/* 22 */     this.droneName = new String(drone);
/*    */   }
/*    */   
/*    */   public boolean execute()
/*    */   {
/* 27 */     if (this.droneName.equals("@Pilot")) {
/* 28 */       Pilot p = Pilot.getActive();
/* 29 */       if (p != null)
/* 30 */         p.animate(this.animation);
/*    */     } else {
/* 32 */       Drone d = ArmyOfZombies.instance().get(this.droneName);
/* 33 */       if (d != null) {
/* 34 */         d.animate(this.animation);
/*    */       }
/*    */     }
/* 37 */     doCallback(true);
/* 38 */     return true;
/*    */   }
/*    */   
/*    */   public void save(DataOutputStream dos) throws IOException
/*    */   {
/* 43 */     super.save(dos);
/* 44 */     dos.writeUTF(this.animation);
/* 45 */     dos.writeUTF(this.droneName);
/*    */   }
/*    */   
/*    */   public void load(DataInputStream dis) throws IOException
/*    */   {
/* 50 */     super.load(dis);
/* 51 */     this.animation = new String(dis.readUTF());
/* 52 */     this.droneName = new String(dis.readUTF());
/*    */   }
/*    */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\BBAnimateDroneCommand.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */