32
32
/**
33
33
* Holds movement path for an entity.
34
34
*/
35
- public class MovePath implements Cloneable , Serializable {
35
+ public class MovePath implements Cloneable , Serializable , Pathing {
36
36
private static final MMLogger logger = MMLogger .create (MovePath .class );
37
37
38
38
private static final long serialVersionUID = -4258296679177532986L ;
@@ -247,6 +247,7 @@ public MovePath(Game game, Entity entity, @Nullable Coords waypoint) {
247
247
* Checks if there is a waypoint referenced by this MovePath.
248
248
* @return true if there is a waypoint, false otherwise.
249
249
*/
250
+ @ Override
250
251
public boolean hasWaypoint () {
251
252
return waypoint != null ;
252
253
}
@@ -255,10 +256,12 @@ public boolean hasWaypoint() {
255
256
* Returns the waypoint referenced by this MovePath.
256
257
* @return the waypoint, or null if there is none.
257
258
*/
259
+ @ Override
258
260
public @ Nullable Coords getWaypoint () {
259
261
return waypoint ;
260
262
}
261
263
264
+ @ Override
262
265
public Entity getEntity () {
263
266
return entity ;
264
267
}
@@ -404,6 +407,7 @@ protected MovePath addStep(final MoveStep step) {
404
407
return addStep (step , true );
405
408
}
406
409
410
+ @ Override
407
411
public Set <Coords > getCoordsSet () {
408
412
if (coordsSet != null ) {
409
413
return coordsSet ;
@@ -993,6 +997,7 @@ public boolean hasActiveSupercharger() {
993
997
* path, or
994
998
* null if there's an issue with determining the coords
995
999
*/
1000
+ @ Override
996
1001
public @ Nullable Coords getFinalCoords () {
997
1002
if (getGame ().useVectorMove ()) {
998
1003
return Compute .getFinalPosition (getEntity ().getPosition (), getFinalVectors ());
@@ -1006,6 +1011,7 @@ public boolean hasActiveSupercharger() {
1006
1011
/**
1007
1012
* Returns the starting {@link Coords} of this path.
1008
1013
*/
1014
+ @ Override
1009
1015
public @ Nullable Coords getStartCoords () {
1010
1016
for (final Enumeration <MoveStep > e = getSteps (); e .hasMoreElements ();) {
1011
1017
final MoveStep step = e .nextElement ();
@@ -1021,6 +1027,7 @@ public boolean hasActiveSupercharger() {
1021
1027
* Returns the final facing if a mek were to perform all the steps in this
1022
1028
* path.
1023
1029
*/
1030
+ @ Override
1024
1031
public int getFinalFacing () {
1025
1032
MoveStep last = getLastStep ();
1026
1033
if (last != null ) {
@@ -1032,6 +1039,7 @@ public int getFinalFacing() {
1032
1039
/**
1033
1040
* Returns whether or not a unit would end up prone after all of the steps
1034
1041
*/
1042
+ @ Override
1035
1043
public boolean getFinalProne () {
1036
1044
if (getLastStep () != null ) {
1037
1045
return getLastStep ().isProne ();
@@ -1342,6 +1350,7 @@ public static int getAdjustedFacing(final int facing, final MoveStepType movemen
1342
1350
/**
1343
1351
* Returns the number of MPs used in the path
1344
1352
*/
1353
+ @ Override
1345
1354
public int getMpUsed () {
1346
1355
if (getLastStep () != null ) {
1347
1356
return getLastStep ().getMpUsed ();
@@ -1353,6 +1362,7 @@ public int getMpUsed() {
1353
1362
* Returns the logical number of hexes moved the path (does not count turns,
1354
1363
* etc).
1355
1364
*/
1365
+ @ Override
1356
1366
public int getHexesMoved () {
1357
1367
if (getLastStep () == null ) {
1358
1368
return 0 ;
@@ -1363,6 +1373,7 @@ public int getHexesMoved() {
1363
1373
/**
1364
1374
* Returns the linear distance between the first and last hexes in the path.
1365
1375
*/
1376
+ @ Override
1366
1377
public int getDistanceTravelled () {
1367
1378
var currentEntityPosition = getEntity ().getPosition ();
1368
1379
if (currentEntityPosition == null ) {
@@ -1378,6 +1389,7 @@ public int getDistanceTravelled() {
1378
1389
/**
1379
1390
* Returns true if the entity is jumping or if it's a flying lam.
1380
1391
*/
1392
+ @ Override
1381
1393
public boolean isJumping () {
1382
1394
return contains (MoveStepType .START_JUMP );
1383
1395
}
0 commit comments