Skip to content

Commit d6c09f3

Browse files
committed
use cached position for get'Side' methods
1 parent a40cd9f commit d6c09f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/bwapi/Unit.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,19 @@ public Region getRegion() {
123123
}
124124

125125
public int getLeft() {
126-
return unitData.positionX() - getType().dimensionLeft();
126+
return position.x - getType().dimensionLeft();
127127
}
128128

129129
public int getTop() {
130-
return unitData.positionY() - getType().dimensionUp();
130+
return position.y - getType().dimensionUp();
131131
}
132132

133133
public int getRight() {
134-
return unitData.positionX() - getType().dimensionRight();
134+
return position.x - getType().dimensionRight();
135135
}
136136

137137
public int getBottom() {
138-
return unitData.positionY() - getType().dimensionDown();
138+
return position.y - getType().dimensionDown();
139139
}
140140

141141
public int getHitPoints() {

0 commit comments

Comments
 (0)