Skip to content

Commit 412e7da

Browse files
committed
2 parents c2af742 + 98d861a commit 412e7da

File tree

6 files changed

+7
-28
lines changed

6 files changed

+7
-28
lines changed

src/main/java/tbooop/commons/impl/Point2dImpl.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ public double distance(final Point2d coord) {
7575
/** {@inheritDoc} */
7676
@Override
7777
public boolean equals(final Object obj) {
78-
if (obj instanceof Point2d) {
79-
return this.vector.equals(toV2D((Point2d) obj));
80-
}
81-
return false;
78+
return obj instanceof Point2d && this.vector.equals(toV2D((Point2d) obj));
8279
}
8380

8481
/** {@inheritDoc} */

src/main/java/tbooop/commons/impl/Vector2dImpl.java

+5-8
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,25 @@ public double getLenght() {
5757
/** {@inheritDoc} */
5858
@Override
5959
public Vector2d normalize() {
60-
return toVector(this.vector.normalize());
60+
return toV2d(this.vector.normalize());
6161
}
6262

6363
/** {@inheritDoc} */
6464
@Override
6565
public Vector2d negate() {
66-
return toVector(this.vector.negate());
66+
return toV2d(this.vector.negate());
6767
}
6868

6969
/** {@inheritDoc} */
7070
@Override
7171
public Vector2d scalarMultiply(final double a) {
72-
return toVector(this.vector.scalarMultiply(a));
72+
return toV2d(this.vector.scalarMultiply(a));
7373
}
7474

7575
/** {@inheritDoc} */
7676
@Override
7777
public boolean equals(final Object obj) {
78-
if (obj instanceof Vector2d) {
79-
return this.vector.equals(toV2D((Vector2d) obj));
80-
}
81-
return false;
78+
return obj instanceof Vector2d && this.vector.equals(toV2D((Vector2d) obj));
8279
}
8380

8481
/** {@inheritDoc} */
@@ -99,7 +96,7 @@ public Point2d toP2d() {
9996
return new Point2dImpl(getX(), getY());
10097
}
10198

102-
private Vector2d toVector(final Vector2D v) {
99+
private Vector2d toV2d(final Vector2D v) {
103100
return new Vector2dImpl(v.getX(), v.getY());
104101
}
105102

src/main/java/tbooop/view/api/Keybinds.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public static boolean isMove(final Keybinds keybind) {
129129
*/
130130
public static Optional<Keybinds> getKeybind(final KeyCode keyCode) {
131131
for (final Keybinds keybind : Keybinds.values()) {
132-
if (keybind.getKeyCode() == keyCode) {
132+
if (keybind.getKeyCode().equals(keyCode)) {
133133
return Optional.of(keybind);
134134
}
135135
}

src/main/java/tbooop/view/pickupables/pickups/PlayerCoinsView.java

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public synchronized void update() {
4040
/** {@inheritDoc} */
4141
@Override
4242
public void init() {
43-
// TODO Auto-generated method stub
4443
throw new UnsupportedOperationException("Unimplemented method 'init'");
4544
}
4645

src/main/java/tbooop/view/pickupables/pickups/PlayerKeysView.java

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public synchronized void update() {
4141
/** {@inheritDoc} */
4242
@Override
4343
public void init() {
44-
// TODO Auto-generated method stub
4544
throw new UnsupportedOperationException("Unimplemented method 'init'");
4645
}
4746

src/test/java/tbooop/AppTest.java

-13
This file was deleted.

0 commit comments

Comments
 (0)