Class SBFMovePath

java.lang.Object
megamek.common.strategicBattleSystems.SBFMovePath
All Implemented Interfaces:
Serializable, EntityAction

public class SBFMovePath extends Object implements EntityAction, Serializable
See Also:
  • Constructor Details

  • Method Details

    • createMovePathShallow

      public static SBFMovePath createMovePathShallow(SBFMovePath original)
      Creates a new move path that is a copy of the given original. Note that the steps are not copied, i.e. the step list is only a shallow copy!
      Parameters:
      original - The move path to copy
      Returns:
      A new move path that is equal to the original
    • createMovePathDeep

      @Deprecated(since="0.51.0", forRemoval=true) public static SBFMovePath createMovePathDeep(SBFMovePath original)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new move path that is a copy of the given original. Note that the steps are copied, i.e. the step list is a deep copy. The returned move path is completely independent of the original.
      Parameters:
      original - The move path to copy
      Returns:
      A new move path that is equal to the original
    • getEntityId

      public int getEntityId()
      Specified by:
      getEntityId in interface EntityAction
      Returns:
      The ID of the acting game unit. Note that when an entity is destroyed, it may no longer be available from Game.getEntity(int) but rather only from Game.getOutOfGameEntity(int) or Game.getEntityFromAllSources(int). As this can happen in the middle of resolving complicated situations in the GameManager, this is a potential cause for bugs.
      Note that this is not restricted to Entity; it can be used for all InGameObjects that are handled in the game.
    • getMpUsed

      public int getMpUsed()
    • addStep

      public void addStep(SBFMoveStep step)
    • getLastStep

      public SBFMoveStep getLastStep()
    • getLastPosition

      public BoardLocation getLastPosition()
    • isIllegal

      public boolean isIllegal()
    • restore

      public void restore(SBFGame game)
      Restores the move path after serialization. This is unnecessary unless the compile() method is used.
      Parameters:
      game - The SBFGame
    • getHexesMoved

      public int getHexesMoved()
      Returns the number of hexes moved
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSteps

      public List<SBFMoveStep> getSteps()
      Returns:
      The steps of this move path as an unmodifiable list.
    • isEndStep

      public boolean isEndStep(SBFMoveStep step)
    • getMpUpTo

      public int getMpUpTo(SBFMoveStep step)
      Returns the number of mp used up to and including the given step. Returns -1 if the step is not part of this move path.
      Parameters:
      step - The last step to include in the cost
      Returns:
      The total mp up to the given step
    • setJumpUsed

      public void setJumpUsed(int jumpUsed)
    • getJumpUsed

      public int getJumpUsed()