Package megamek.common.equipment
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
An interface defining all the required properties of a carryable object.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDespite being carried by a unit in the same manner, the type of object impacts when it should be damaged if a carried object's carrier is attacked. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanBePickedUp(boolean isCarrierHullDown) Returns true if the carryable object is able to be picked up.booleandamage(double amount) Damages this carryable object by the given amount of damage.doubledefault booleanFor future reference.booleanReturns true if this carryable object should never take damage nor be destroyed, false otherwise.voidprocessPickupStep(MoveStep step, Integer cargoPickupLocation, TWGameManager gameManager, Entity entityPickingUpTarget, EntityMovementType overallMoveType) default intMethods inherited from interface megamek.common.units.BTObject
generalName, getFluffImage, getIcon, hasAerodyneSpheroidDistinction, isAero, isAerodyne, isAerospace, isAerospaceFighter, isAerospaceSV, isBattleArmor, isBattlefieldSupportAsset, isBattleMek, isCombatVehicle, isConventionalFighter, isConventionalInfantry, isDropShip, isFighter, isFixedWingSupport, isGround, isHandheldWeapon, isIndustrialMek, isInfantry, isJumpShip, isLargeAerospace, isMek, isObjectiveMarker, isProtoMek, isQuadMek, isSingleUnit, isSmallCraft, isSpaceStation, isSpheroid, isSupportVehicle, isTripodMek, isUnitGroup, isVehicle, isWarShip, specificNameMethods inherited from interface megamek.common.game.InGameObject
countForStrengthSum, getId, getOwnerId, getStrength, hasOwner, setId, setOwnerId
-
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 ofdamage(double)to test it.- Returns:
- True if this carryable object cannot be damaged
-
isCarryableObject
default boolean isCarryableObject()Description copied from interface:BTObjectFor 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:
isCarryableObjectin interfaceBTObject- 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
-
processPickupStep
void processPickupStep(MoveStep step, Integer cargoPickupLocation, TWGameManager gameManager, Entity entityPickingUpTarget, EntityMovementType overallMoveType) -
targetForArmHitToHitCarriedObject
default int targetForArmHitToHitCarriedObject()
-