@@ -23,9 +23,14 @@ of this software and associated documentation files (the "Software"), to deal
2323SOFTWARE.
2424*/
2525
26- package bwapi ;
26+ package bwapi . client ;
2727
28- class Client {
28+ import bwapi .BWClient ;
29+ import bwapi .ClientData ;
30+ import bwapi .client .*;
31+
32+
33+ public class Client {
2934 private static final int SUPPORTED_BWAPI_VERSION = 10003 ;
3035
3136 private ClientData clientData ;
@@ -35,34 +40,36 @@ class Client {
3540 private WrappedBuffer gameTableShm = null ;
3641 private final ClientConnection clientConnector ;
3742
38- Client (BWClient bwClient ) {
43+ public Client (BWClient bwClient ) {
3944 this .bwClient = bwClient ;
4045 boolean windowsOs = System .getProperty ("os.name" ).toLowerCase ().contains ("win" );
41- clientConnector = windowsOs ? new ClientConnectionW32 () : new ClientConnectionPosix ();
46+ clientConnector = windowsOs ?
47+ new ClientConnectionW32 (ClientData .GameData .SIZE ) :
48+ new ClientConnectionPosix (ClientData .GameData .SIZE );
4249 }
4350
4451 /**
4552 * For test purposes only
4653 */
47- Client (final WrappedBuffer buffer ) {
54+ public Client (final WrappedBuffer buffer ) {
4855 clientData = new ClientData ();
4956 clientData .setBuffer (buffer );
5057 clientConnector = null ;
5158 }
5259
53- ClientData liveClientData () {
60+ public ClientData liveClientData () {
5461 return clientData ;
5562 }
5663
57- WrappedBuffer mapFile () {
64+ public WrappedBuffer mapFile () {
5865 return mapShm ;
5966 }
6067
61- boolean isConnected () {
68+ public boolean isConnected () {
6269 return connected ;
6370 }
6471
65- void reconnect () {
72+ public void reconnect () {
6673 while (!connect ()) {
6774 sleep (1000 );
6875 }
@@ -114,7 +121,7 @@ boolean connect() {
114121
115122 int oldest = Integer .MAX_VALUE ;
116123 for (int i = 0 ; i < GameTable .MAX_GAME_INSTANCES ; i ++) {
117- GameInstance gameInstance = gameTable .gameInstances [i ];
124+ GameTable . GameInstance gameInstance = gameTable .gameInstances [i ];
118125 System .out .println (i + " | " + gameInstance .serverProcessID + " | " + (gameInstance .isConnected ? 1 : 0 ) + " | " + gameInstance .lastKeepAliveTime );
119126 if (gameInstance .serverProcessID != 0 && !gameInstance .isConnected ) {
120127 if (gameTableIndex == -1 || gameInstance .lastKeepAliveTime < oldest ) {
@@ -193,7 +200,7 @@ boolean connect() {
193200 return true ;
194201 }
195202
196- void sendFrameReceiveFrame () {
203+ public void sendFrameReceiveFrame () {
197204 final PerformanceMetrics metrics = bwClient .getPerformanceMetrics ();
198205
199206 // Tell BWAPI that we are done with the current frame
0 commit comments