@@ -18,6 +18,16 @@ public class Client {
1818 private ByteBuffer sharedMemory ;
1919 private LittleEndianPipe pipe ;
2020
21+ public static class UnitCommand {
22+ public int type , unit , target , x , y , extra ;
23+ private static final int SIZE = 24 ;
24+ }
25+
26+ public static class Command {
27+ public int type , value1 , value2 ;
28+ private static final int SIZE = 12 ;
29+ }
30+
2131 public final class GameData {
2232 private String parseString (int offset , int maxLen ) {
2333 byte [] buf = new byte [maxLen ];
@@ -433,13 +443,6 @@ public void addShape(Shape shape) {
433443
434444 private static final int CommandOffset = 0x1ebfbcc ;
435445
436- public class Command {
437- int type , value1 , value2 ;
438- public Command (int type , int value1 , int value2 ) { this .type = type ; this .value1 = value1 ; this .value2 = value2 ; }
439-
440- private static final int SIZE = 12 ;
441- }
442-
443446 public void addCommand (Command command ) {
444447 int at = sharedMemory .getInt (CommandOffset );
445448 sharedMemory .putInt (CommandOffset + at * Command .SIZE + 4 , command .type );
@@ -450,15 +453,6 @@ public void addCommand(Command command) {
450453
451454 private static final int UnitCommandOffset = 0x1efa550 ;
452455
453-
454- public class UnitCommand {
455- int type , unit , target , x , y , extra ;
456- public UnitCommand (int type , int unit , int target , int x , int y , int extra )
457- { this .type = type ; this .unit = unit ; this .target = target ; this .x = x ; this .y = y ; this .extra = extra ; }
458-
459- private static final int SIZE = 24 ;
460- }
461-
462456 public void addUnitCommand (UnitCommand command ) {
463457 int at = sharedMemory .getInt (UnitCommandOffset );
464458 sharedMemory .putInt (UnitCommandOffset + at * UnitCommand .SIZE + 4 , command .type );
0 commit comments