File tree Expand file tree Collapse file tree 3 files changed +26
-32
lines changed
Expand file tree Collapse file tree 3 files changed +26
-32
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,6 @@ public enum Race{
2727 this .id = id ;
2828 }
2929
30- public String toString () {
31- return null ;
32- }
33-
3430 public UnitType getWorker () {
3531 return workerTypes [id ];
3632 }
Original file line number Diff line number Diff line change 1+ import bwapi .DefaultBWListener ;
2+ import bwapi .BWClient ;
3+ import bwapi .Game ;
4+ import bwapi .Player ;
5+
6+ public class MinimalListener extends DefaultBWListener {
7+ final BWClient bwClient ;
8+
9+ Game game ;
10+
11+ MinimalListener () {
12+ bwClient = new BWClient (this );
13+ bwClient .startGame ();
14+ }
15+
16+ public void onStart () {
17+ game = bwClient .getGame ();
18+ Player self = game .self ();
19+ Player enemy = game .enemy ();
20+ System .out .println (self .getName () + " (" + self .getRace () + ") vs " + enemy .getName () + " (" + enemy .getRace () + ")" );
21+ }
22+
23+ public static void main (String [] args ) {
24+ new MinimalListener ();
25+ }
26+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments