Interface ICarryable

All Superinterfaces:
BTObject, InGameObject
All Known Implementing Classes:
AbstractBuildingEntity, Aero, AeroSpaceFighter, BattleArmor, BattlefieldSupportAsset, BipedMek, Briefcase, BuildingEntity, Cargo, CombatVehicleEscapePod, ConvFighter, ConvInfantry, Dropship, EjectedCrew, Entity, EscapePods, FighterSquadron, FixedWingSupport, GroundObject, GunEmplacement, HandheldWeapon, Infantry, Jumpship, LandAirMek, LargeSupportTank, Mek, MekWarrior, MekWithArms, MobileStructure, ProtoMek, QuadMek, QuadVee, SmallCraft, SpaceStation, SuperHeavyTank, SupportTank, SupportVTOL, Tank, TeleMissile, TripodMek, VTOL, Warship

public interface ICarryable extends InGameObject
An interface defining all the required properties of a carryable object.
  • Method Details

    • getTonnage

      double getTonnage()
      Returns:
      The weight of the carryable object in units of tons.
    • damage

      boolean damage(double amount)
      Damages this carryable object by the given amount of damage. Returns true if the cargo is considered destroyed by applying the damage. Note: This method does *not* check if the object is invulnerable; it is up to the caller to do that. Calling this method on an invulnerable carryable object behaves exactly like calling it on a vulnerable one.
      Parameters:
      amount - The damage
      Returns:
      True if the cargo is destroyed by the damage, false otherwise
      See Also:
    • isInvulnerable

      boolean isInvulnerable()
      Returns true if this carryable object should never take damage nor be destroyed, false otherwise. Note that the carryable object does *not* itself enforce this; it is up to the caller of damage(double) to test it.
      Returns:
      True if this carryable object cannot be damaged
    • isCarryableObject

      default boolean isCarryableObject()
      Description copied from interface: BTObject
      For future reference. Returns true when this object is a battlefield object (such as a crate) that can be picked up and carried by some types of units.
      Specified by:
      isCarryableObject in interface BTObject
      Returns:
      True when this is a carryable battlefield object.
    • canBePickedUp

      boolean canBePickedUp(boolean isCarrierHullDown)
      Returns true if the carryable object is able to be picked up.
      Parameters:
      isCarrierHullDown - is the unit that's picking this up hull down, or otherwise able to pick up ground-level objects
      Returns:
      true if the object can be picked up, false if it cannot
    • getCarriedObjectDamageAllocation

      default ICarryable.CarriedObjectDamageAllocation getCarriedObjectDamageAllocation()
    • processPickupStep

      void processPickupStep(MoveStep step, Integer cargoPickupLocation, TWGameManager gameManager, Entity entityPickingUpTarget, EntityMovementType overallMoveType)
    • targetForArmHitToHitCarriedObject

      default int targetForArmHitToHitCarriedObject()