Skip to content

Commit 522ece3

Browse files
flTobiNicholasBatesNZ
authored andcommitted
Checkstyle: Address various other suggestions
1 parent 98beb62 commit 522ece3

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

engine/src/main/java/org/destinationsol/game/chunk/ChunkManager.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public class ChunkManager implements UpdateAwareSystem {
3838
private final RemoveController backgroundRemoveController;
3939
private final ChunkFiller filler;
4040

41-
private int X;
42-
private int Y;
41+
private int x;
42+
private int y;
4343

4444
public ChunkManager() {
4545
filledChunks = new HashSet<>();
@@ -62,11 +62,11 @@ public void update(SolGame game, float timeStep) {
6262
}
6363

6464
private boolean updateCurrChunk(Vector2 position) {
65-
int oldX = X;
66-
int oldY = Y;
67-
X = posToChunkIdx(position.x);
68-
Y = posToChunkIdx(position.y);
69-
return oldX != X || oldY != Y;
65+
int oldX = x;
66+
int oldY = y;
67+
x = posToChunkIdx(position.x);
68+
y = posToChunkIdx(position.y);
69+
return oldX != x || oldY != y;
7070
}
7171

7272
private int posToChunkIdx(float v) {
@@ -82,7 +82,7 @@ private void clearFarChunks(Set<Vector2> chunks, int dist) {
8282
}
8383

8484
private boolean isChunkFar(int x, int y, int dist) {
85-
return x <= X - dist || X + dist <= x || y <= Y - dist || Y + dist <= y;
85+
return x <= this.x - dist || this.x + dist <= x || y <= this.y - dist || this.y + dist <= y;
8686
}
8787

8888
private void addNewChunks(Set<Vector2> chunks, int dist, SolGame game) {
@@ -98,7 +98,7 @@ private void addNewChunks(Set<Vector2> chunks, int dist, SolGame game) {
9898
}
9999

100100
private void maybeAddChunk(Set<Vector2> chunks, int oX, int oY, SolGame game) {
101-
Vector2 v = SolMath.getVec(X + oX, Y + oY);
101+
Vector2 v = SolMath.getVec(x + oX, y + oY);
102102
if (!chunks.contains(v)) {
103103
Vector2 chunk = new Vector2(v);
104104
chunks.add(chunk);

engine/src/main/java/org/destinationsol/game/input/Pilot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public interface Pilot {
5454

5555
boolean isPlayer();
5656

57-
public static final class Utils {
57+
final class Utils {
5858
public static boolean isIdle(Pilot p) {
5959
return !(p.isUp() || p.isShoot() || p.isShoot2() || p.isAbility());
6060
}

engine/src/main/java/org/destinationsol/game/ship/FarShip.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ public MercItem getMerc() {
211211
return this.mercItem;
212212
}
213213

214-
public boolean isMerc() { return this.isMerc; }
214+
public boolean isMerc() {
215+
return this.isMerc;
216+
}
215217

216218
}

engine/src/main/java/org/destinationsol/game/ship/SolShip.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private boolean tryCollectLoot(SolObject obj, SolGame game) {
190190
boolean canAdd = c.canAdd(i);
191191
if (canAdd) {
192192
c.add(i);
193-
if (c == myItemContainer && myPilot.getMapHint() == "Merc") {
193+
if (c == myItemContainer && myPilot.getMapHint().equals("Merc")) {
194194
//insert equip code here, if it's something we want to do
195195
}
196196
}

0 commit comments

Comments
 (0)