summaryrefslogtreecommitdiff
path: root/NET/worlds/console/BBDroneDeltaPosCommand.java
blob: 07c21400a06ebdb5bc80c8723f7c8ffdc6c53875 (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
/*    */ package NET.worlds.console;
/*    */ 
/*    */ import NET.worlds.scape.Drone;
/*    */ import NET.worlds.scape.HoloPilot;
/*    */ import java.io.DataInputStream;
/*    */ import java.io.DataOutputStream;
/*    */ import java.io.IOException;
/*    */ 
/*    */ public class BBDroneDeltaPosCommand extends BlackBoxCommand
/*    */ {
/*    */   private byte dx;
/*    */   private byte dy;
/*    */   private byte dyaw;
/*    */   private String droneID;
/*    */   
/*    */   public BBDroneDeltaPosCommand()
/*    */   {
/* 18 */     this.commandType = 8;
/*    */   }
/*    */   
/*    */   public BBDroneDeltaPosCommand(String pdroneID, byte pdx, byte pdy, byte pdyaw)
/*    */   {
/* 23 */     this();
/* 24 */     this.droneID = pdroneID;
/* 25 */     this.dx = pdx;
/* 26 */     this.dy = pdy;
/* 27 */     this.dyaw = pdyaw;
/*    */   }
/*    */   
/*    */   public boolean execute()
/*    */   {
/* 32 */     Drone id = null;
/*    */     
/* 34 */     if (this.droneID.equals("@Pilot")) {
/* 35 */       NET.worlds.scape.Pilot p = NET.worlds.scape.Pilot.getActive();
/* 36 */       if ((p != null) && 
/* 37 */         ((p instanceof HoloPilot))) {
/* 38 */         HoloPilot hp = (HoloPilot)p;
/* 39 */         Drone d = hp.getInternalDrone();
/* 40 */         if ((d != null) && 
/* 41 */           ((d instanceof Drone))) {
/* 42 */           id = d;
/*    */         }
/*    */       }
/*    */     }
/*    */     else
/*    */     {
/* 48 */       id = ArmyOfZombies.instance().get(this.droneID);
/*    */     }
/*    */     
/* 51 */     if (id != null) {
/* 52 */       id.shortLoc(this.dx, this.dy, this.dyaw);
/* 53 */       doCallback(true);
/* 54 */       return true;
/*    */     }
/*    */     
/* 57 */     doCallback(true);
/* 58 */     return true;
/*    */   }
/*    */   
/*    */   public void save(DataOutputStream dos) throws IOException
/*    */   {
/* 63 */     super.save(dos);
/* 64 */     dos.writeUTF(this.droneID);
/* 65 */     dos.writeByte(this.dx);
/* 66 */     dos.writeByte(this.dy);
/* 67 */     dos.writeByte(this.dyaw);
/*    */   }
/*    */   
/*    */   public void load(DataInputStream dis) throws IOException
/*    */   {
/* 72 */     super.load(dis);
/* 73 */     this.droneID = dis.readUTF();
/* 74 */     this.dx = dis.readByte();
/* 75 */     this.dy = dis.readByte();
/* 76 */     this.dyaw = dis.readByte();
/*    */   }
/*    */ }


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