Class UnitBehavior

java.lang.Object
megamek.client.bot.princess.UnitBehavior

public class UnitBehavior extends Object
  • Constructor Details

    • UnitBehavior

      public UnitBehavior()
  • Method Details

    • getBehaviorType

      public UnitBehavior.BehaviorType getBehaviorType(Entity entity, Princess owner)
      Gets (and calculates, if necessary), the behavior type for the given entity.
    • overrideBehaviorType

      public void overrideBehaviorType(Entity entity, UnitBehavior.BehaviorType behaviorType)
    • getWaypointForEntity

      public Optional<Coords> getWaypointForEntity(Entity entity)
    • isDestinationValidForEntity

      public boolean isDestinationValidForEntity(Entity entity, Coords destination, Princess owner)
    • addEntityWaypoint

      public boolean addEntityWaypoint(Entity entity, List<Coords> waypoints, Princess owner)
    • addEntityWaypoint

      public boolean addEntityWaypoint(Entity entity, Coords destination, Princess owner)
    • removeHeadWaypoint

      public Optional<Coords> removeHeadWaypoint(Entity entity)
      Removes the head waypoint from the entity's waypoint queue If waypoints were added (1,1) then (2,2), then (3,3), this would remove (1,1)
      Parameters:
      entity - the entity to remove the waypoint from
    • removeTailWaypoint

      public Optional<Coords> removeTailWaypoint(Entity entity)
      Removes the tail waypoint from the entity's waypoint queue If waypoints were added (1,1) then (2,2) then (3,3), this would remove (3,3), good for an "undo" behavior.
      Parameters:
      entity - the entity to remove the waypoint from
    • setEntityWaypoints

      public boolean setEntityWaypoints(Entity entity, List<Coords> waypoints, Princess owner)
      Sets the entity's waypoints to the given destination
      Parameters:
      entity -
      waypoints -
      owner -
      Returns:
    • clearWaypoints

      public boolean clearWaypoints(Entity entity)
    • clearWaypoints

      public void clearWaypoints()
    • clear

      public void clear()
      Clears the entity behavior cache, should be done at the start of each movement phase