summaryrefslogtreecommitdiff
path: root/NET/worlds/console/BBMoveDroneCommand.java
blob: ec775fc3afd4d256011c05e70d13080d80960804 (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
/*    */ package NET.worlds.console;
/*    */ 
/*    */ import NET.worlds.scape.Drone;
/*    */ import NET.worlds.scape.HoloPilot;
/*    */ import java.io.DataInputStream;
/*    */ import java.io.DataOutputStream;
/*    */ 
/*    */ public class BBMoveDroneCommand extends BlackBoxCommand
/*    */ {
/*    */   private short x;
/*    */   private short y;
/*    */   private short z;
/*    */   private short dir;
/*    */   private String droneID;
/*    */   
/*    */   public BBMoveDroneCommand()
/*    */   {
/* 18 */     this.commandType = 3;
/*    */   }
/*    */   
/*    */   public BBMoveDroneCommand(String pdroneID, short px, short py, short pz, short pdir)
/*    */   {
/* 23 */     this();
/* 24 */     this.droneID = pdroneID;
/* 25 */     this.x = px;
/* 26 */     this.y = py;
/* 27 */     this.z = pz;
/* 28 */     this.dir = pdir;
/*    */   }
/*    */   
/*    */   public boolean execute()
/*    */   {
/* 33 */     Drone id = null;
/*    */     
/* 35 */     if (this.droneID.equals("@Pilot")) {
/* 36 */       NET.worlds.scape.Pilot p = NET.worlds.scape.Pilot.getActive();
/* 37 */       if ((p != null) && 
/* 38 */         ((p instanceof HoloPilot))) {
/* 39 */         HoloPilot hp = (HoloPilot)p;
/* 40 */         id = hp.getInternalDrone();
/*    */       }
/*    */     }
/*    */     else {
/* 44 */       id = ArmyOfZombies.instance().get(this.droneID);
/*    */     }
/*    */     
/* 47 */     if (id != null) {
/* 48 */       short _dir = this.dir;
/* 49 */       _dir = (short)(90 - _dir);
/* 50 */       _dir = (short)(360 - _dir);
/* 51 */       id.longLoc(this.x, this.y, this.z, _dir);
/*    */       
/* 53 */       doCallback(true);
/* 54 */       return true;
/*    */     }
/*    */     
/* 57 */     doCallback(true);
/* 58 */     return true;
/*    */   }
/*    */   
/*    */   public void save(DataOutputStream dos) throws java.io.IOException
/*    */   {
/* 63 */     super.save(dos);
/* 64 */     dos.writeUTF(this.droneID);
/* 65 */     dos.writeShort(this.x);
/* 66 */     dos.writeShort(this.y);
/* 67 */     dos.writeShort(this.z);
/* 68 */     dos.writeShort(this.dir);
/*    */   }
/*    */   
/*    */   public void load(DataInputStream dis) throws java.io.IOException
/*    */   {
/* 73 */     super.load(dis);
/* 74 */     this.droneID = dis.readUTF();
/* 75 */     this.x = dis.readShort();
/* 76 */     this.y = dis.readShort();
/* 77 */     this.z = dis.readShort();
/* 78 */     this.dir = dis.readShort();
/*    */   }
/*    */ }


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