Skip to content

Commit

Permalink
bwmirror 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vjurenka committed Apr 19, 2015
1 parent 692411f commit 7f2d137
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 3 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ http://vjurenka.github.io/BWMirror/javadoc/ , but v2 has only a few comments in

**My bot prints the message "Error: Client and Server are not compatible! Client Revision: 4625 Server Revision: 4615" and and fails to load. What's the problem?**

You have an older version of BWAPI. Please reinstall BWAPI with the correct version (BWAPI v4.1.0-Beta).
You can chceck your BWAPI revision in ChaosLauncher, by selecting the BWAPI injector plugin. Revision 4625 is required.
Please update to BWMirror 2.3. If you updated and get the reverse error (client 4615, server 4625), reinstall BWAPI.

**My bot prints the message "BWMirror API supports only x86 architecture." and fails to load. What's the problem?**

Expand All @@ -66,6 +65,11 @@ The first time BWTA analyses a map, it can take a few minutes. The results are s

##Changelog

**v 2.3**
- Revision 4615 is now required. This is the revision number of BWAPI4.1 official release.
- Order now has toString method
- Polygon now has getHoles() and getPoints() methods

**v 2.2**
- Fixed issues with BWTA2 methods

Expand Down
2 changes: 1 addition & 1 deletion api/bwapi/Mirror.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class Mirror {

private static final boolean EXTRACT_JAR = true;

private static final String VERSION = "2_1";
private static final String VERSION = "2_3";

static {
String arch = System.getProperty("os.arch");
Expand Down
6 changes: 6 additions & 0 deletions api/bwapi/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

public class Order {

public String toString() {
return toString_native(pointer);
}

public static Order Die;

public static Order Stop;
Expand Down Expand Up @@ -342,5 +346,7 @@ private static Order get(long pointer) {

private long pointer;

private native String toString_native(long pointer);


}
6 changes: 6 additions & 0 deletions api/bwta/BWTA.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public class BWTA {

public static native void balanceAnalysis();

public static native void cleanMemory();

public static native int getMaxDistanceTransform();

public static native List<Region> getRegions();
Expand Down Expand Up @@ -70,6 +72,10 @@ public class BWTA {

public static native Map<TilePosition, Double> getGroundDistances(TilePosition start, List<TilePosition> targets);

public static native List<TilePosition> getShortestPath(TilePosition start, TilePosition end);

public static native List<TilePosition> getShortestPath(TilePosition start, List<TilePosition> targets);

public static native void buildChokeNodes();

public static native int getGroundDistance2(TilePosition start, TilePosition end);
Expand Down
12 changes: 12 additions & 0 deletions api/bwta/Polygon.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ public Position getNearestPoint(Position p) {
return getNearestPoint_native(pointer, p);
}

public List<Polygon> getHoles() {
return getHoles_native(pointer);
}

public List<Position> getPoints() {
return getPoints_native(pointer);
}


private static Map<Long, Polygon> instances = new HashMap<Long, Polygon>();

Expand Down Expand Up @@ -65,5 +73,9 @@ private static Polygon get(long pointer) {

private native Position getNearestPoint_native(long pointer, Position p);

private native List<Polygon> getHoles_native(long pointer);

private native List<Position> getPoints_native(long pointer);


}
Binary file added dist/bwmirror_v2_3.jar
Binary file not shown.

0 comments on commit 7f2d137

Please sign in to comment.