Skip to content

Commit 3233a4f

Browse files
author
Jasper Geurtz
committed
Document UnitCommand assignTarget and equals/hashCode differences vs C++ BWAPI
1 parent 7b64d19 commit 3233a4f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎src/main/java/bwapi/UnitCommand.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ private UnitCommand(final Unit unit, final UnitCommandType type) {
2020
}
2121

2222
private <T extends Point<T>> void assignTarget(Point<T> target) {
23+
// Note: C++ BWAPI clamps target via target.makeValid() to [0, (mapWidth * 32) / scale - 1] and [0, (mapHeight * 32) / scale - 1].
2324
this.x = target.x;
2425
this.y = target.y;
2526
}
@@ -410,6 +411,7 @@ public boolean isQueued() {
410411
&& extra != 0;
411412
}
412413

414+
// Note: C++ BWAPI excludes `unit` when comparing UnitCommands, but JBWAPI includes `unit` in equals and hashCode.
413415
@Override
414416
public boolean equals(Object o) {
415417
if (this == o) return true;

0 commit comments

Comments
 (0)