Class BulldozerMovePath

java.lang.Object
megamek.common.moves.MovePath
megamek.common.BulldozerMovePath
All Implemented Interfaces:
Serializable, Cloneable

public class BulldozerMovePath extends MovePath
An extension of the MovePath class that stores information about terrain that needs to be destroyed in order to move along the specified route.
See Also:
  • Field Details

  • Constructor Details

    • BulldozerMovePath

      public BulldozerMovePath(Game game, Entity entity)
  • Method Details

    • getAdditionalCost

      public int getAdditionalCost()
      Any additional costs of this move paths, such as stepping into water or other factors that would increase the number of turns to complete it without increasing the actual MP used.
    • getLevelingCost

      public int getLevelingCost()
      An estimation of how many MP we would "waste" blowing down obstacles.
    • addStep

      public MovePath addStep(MoveStepType type)
      Override of the MovePath.addStep method that records the leveling and other extra costs associated with this bulldozer move path. The cost computation itself lives in MovePathTerrainCost.
      Overrides:
      addStep in class MovePath
      Parameters:
      type - the type of movement.
    • removeLastStep

      public void removeLastStep()
      Removes the last step from the path and updates its internal data structures accordingly
      Overrides:
      removeLastStep in class MovePath
    • clone

      public BulldozerMovePath clone()
      Clones this path, will contain a new clone of the steps so that the clone is independent of the original.
      Overrides:
      clone in class MovePath
      Returns:
      the cloned MovePath
    • calculateLevelingCost

      public static int calculateLevelingCost(Coords finalCoords, Entity entity)
      Worker function that calculates the "MP cost" of moving into the given set of coords if we were to stand still for the number of turns required to reduce the terrain there to a form through which the current unit can move
    • needsLeveling

      public boolean needsLeveling()
      Whether this path will require terrain reduction to fully accomplish
    • getCoordsToLevel

      public List<Coords> getCoordsToLevel()
      The coordinates which need to be leveled for this path to be performed by its unit
    • getDestination

      public Coords getDestination()
    • setDestination

      public void setDestination(Coords d)
    • toString

      public String toString()
      Overrides:
      toString in class MovePath