File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed
Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,7 @@ public class BulletData {
281281 public int remainingLatencyFrames () { return sharedMemory .getInt (GameOffset + 16 ); }
282282 public int remainingLatencyTime () { return sharedMemory .getInt (GameOffset + 20 ); }
283283 public boolean hasLatCom () { return sharedMemory .get (GameOffset + 24 ) != 0 ; }
284+ public void setLatcom (boolean enable ) { sharedMemory .put (GameOffset + 24 , (byte )(enable ? 1 : 0 )); }
284285 public boolean hasGUI () { return sharedMemory .get (GameOffset + 25 ) != 0 ; }
285286 public int replayFrameCount () { return sharedMemory .getInt (GameOffset + 28 ); }
286287 public int randomSeed () { return sharedMemory .getInt (GameOffset + 32 ); }
Original file line number Diff line number Diff line change @@ -791,8 +791,10 @@ public boolean isLatComEnabled() {
791791 return gameData .hasLatCom ();
792792 }
793793
794- //TODO
795- //public void setLatCom(boolean isEnabled);
794+
795+ public void setLatCom (final boolean isEnabled ) {
796+ gameData .setLatcom (isEnabled );
797+ }
796798
797799 public int getInstanceNumber () {
798800 return gameData .getInstanceID ();
Original file line number Diff line number Diff line change 1+ package game ;
2+
3+ import bwapi .BWClient ;
4+ import bwapi .DefaultBWListener ;
5+ import bwapi .Game ;
6+
7+ public class GameTest extends DefaultBWListener {
8+ final BWClient bwClient ;
9+
10+ Game game ;
11+
12+ GameTest () {
13+ bwClient = new BWClient (this );
14+ bwClient .startGame ();
15+ }
16+
17+ public void onStart () {
18+ game = bwClient .getGame ();
19+ assert game != null ;
20+ assert game .isLatComEnabled ();
21+ game .setLatCom (false );
22+ assert !game .isLatComEnabled ();
23+ }
24+
25+ public static void main (String [] args ) {
26+ new GameTest ();
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments