Package megamek.common.units
Class AbstractBuildingEntity
java.lang.Object
megamek.common.turns.TurnOrdered
megamek.common.units.Entity
megamek.common.units.AbstractBuildingEntity
- All Implemented Interfaces:
Serializable,ICarryable,Transporter,InGameObject,CombatRole,ForceAssignable,ITechnology,ITurnOrdered,PhaseUpdated,RoundUpdated,BTObject,Deployable,IBuilding,Targetable
- Direct Known Subclasses:
BuildingEntity,MobileStructure
AbstractBuildingEntity represents a non-terrain building (e.g., a moving fortress). This is the common implementation
of the Mobile Structure rules from TO:AUE and Advanced Building rules from TO:AUE.
It contains a
It contains a
Building (which stores data in relative coordinates) and handles translation between board
coordinates and the Building's relative coordinate space. Unlike BuildingTerrain, the translation is dynamic based on
Entity's current position/facing.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class megamek.common.units.Entity
Entity.InvalidSourceBuildReasonNested classes/interfaces inherited from interface megamek.common.equipment.ICarryable
ICarryable.CarriedObjectDamageAllocation -
Field Summary
FieldsFields inherited from class megamek.common.units.Entity
_isEMId, abandonmentAnnouncedRound, ALTERNATE_MASC_FAILURE, ALTERNATE_MASC_FAILURE_ENHANCED, altitude, ammoList, armorTechLevel, armorTechRating, armorTonnage, armorType, armsFlipped, asewAffectedTurns, aTracker, baVDNINeedsFeedbackMessage, BLOOD_STALKER_TARGET_CLEARED, bMASCWentUp, bombList, boobyTrapInitiated, bSuperchargerWentUp, C3_NETWORK_ID_SEPARATOR, c3CompanyMasterIndex, c3Master, c3NetIdString, camouflage, canUnstickByJumping, carcass, chassis, clanChassisName, climbing, climbingLevelsChosen, consecutiveRHSUses, convertingNow, coolFromExternal, crits, damageThisPhase, damageThisRound, dangling, delta_distance, designValid, destroyed, displacementAttack, DMG_CRIPPLED, DMG_HEAVY, DMG_LIGHT, DMG_MODERATE, DMG_NONE, dodging, DOES_NOT_TRACK_HEAT, done, doomed, eiShutdown, elevation, empInterferenceHeat, empInterferenceRounds, empShutdownRounds, engineHitsThisPhase, engineTechRating, equipmentList, ETYPE_AERO, ETYPE_AEROSPACE_FIGHTER, ETYPE_ARMLESS_MEK, ETYPE_BATTLEARMOR, ETYPE_BATTLEFIELD_SUPPORT_ASSET, ETYPE_BIPED_MEK, ETYPE_BUILDING_ENTITY, ETYPE_COMBAT_VEHICLE_ESCAPE_POD, ETYPE_CONV_FIGHTER, ETYPE_DROPSHIP, ETYPE_FIGHTER_SQUADRON, ETYPE_FIXED_WING_SUPPORT, ETYPE_GUN_EMPLACEMENT, ETYPE_HANDHELD_WEAPON, ETYPE_INFANTRY, ETYPE_JUMPSHIP, ETYPE_LAND_AIR_MEK, ETYPE_LARGE_SUPPORT_TANK, ETYPE_MEK, ETYPE_MEKWARRIOR, ETYPE_PROTOMEK, ETYPE_QUAD_MEK, ETYPE_QUADVEE, ETYPE_SMALL_CRAFT, ETYPE_SPACE_STATION, ETYPE_SUPER_HEAVY_TANK, ETYPE_SUPPORT_TANK, ETYPE_SUPPORT_VTOL, ETYPE_TANK, ETYPE_TELEMISSILE, ETYPE_TRIPOD_MEK, ETYPE_VTOL, ETYPE_WARSHIP, externalId, facing, failedEquipmentList, fell, findingClub, firingSolutions, fluff, game, gotPavementOrRoadBonus, GRAPPLE_BOTH, GRAPPLE_LEFT, GRAPPLE_RIGHT, hardenedArmorDamaged, hasDamagedRHS, hasExternalSearchlight, heat, heatBuildup, heatFromExternal, heatSinkCoolantFailureFactor, hiddenActivationPhase, hullDown, icon, id, iGame, illuminated, iNarcPods, incomingGuidedAttacks, infernos, initialBV, inReverse, isC3ecmAffected, isCarefulStanding, isHidden, isJumpingNow, jumpMP, killerId, lastTarget, lastTargetDisplayName, layingMines, LOC_DESTROYED, LOC_NONE, locationBlownOff, locationBlownOffThisPhase, m_lNarcedBy, m_lPendingNarc, madePointblankShot, manualBV, manualShutdown, MASC_FAILURE, MAX_C3_NODES, MAX_C3i_NODES, MAX_NOVA_CEWS_NODES, military, miscList, mixedTech, model, moved, movedLastRound, movementMode, mpUsed, mpUsedLastRound, mulId, narcPods, nCrew, nMarines, nMASCLevel, nPassenger, nSuperchargerLevel, OBSOLETE_UNKNOWN_MARKER, omni, owner, ownerId, pendingAbandon, pendingINarcPods, pendingNarcPods, previousMovementMode, prone, published, reckless, reportedVDNIFeedbackThisPhase, rhsWentUp, rolledForEngineExplosion, searchlightIsActive, searchlightOverride, sec_facing, secondaryPositions, selfDestructedThisTurn, selfDestructing, selfDestructInitiated, sensorContacts, shutDown, shutdownByBATaser, shutDownThisPhase, source, spotting, STARTING_ANY_NONE, startupThisPhase, struck, structuralTechRating, structureTechLevel, structureType, stuckInSwamp, TA_ARMORED_COMPONENT, TA_MIXED_TECH, TA_OMNI, TA_PATCHWORK_ARMOR, taggedBy, targetBay, taserFeedBackRounds, taserInterference, taserInterferenceHeat, taserInterferenceRounds, taserShutdownRounds, techFaction, techLevel, tmTracker, totalWeaponList, traitorId, twistedPhase, underwaterRounds, unjammingRAC, UNLIMITED_JUMP_DOWN, usedMASC, usedRHSLastTurn, usedSearchlight, usedSupercharger, useManualBV, vectors, walkMP, weaponBayList, weaponGroupList, weaponList, weight, wigeBonus, yearFields inherited from interface megamek.common.units.IBuilding
FORTRESS, GUN_EMPLACEMENT, HANGAR, STANDARD, UNKNOWNFields inherited from interface megamek.common.interfaces.ITechnology
DATE_ES, DATE_NONE, DATE_PSFields inherited from interface megamek.common.units.Targetable
TYPE_BLDG_IGNITE, TYPE_BLDG_TAG, TYPE_BUILDING, TYPE_ENTITY, TYPE_FLARE_DELIVER, TYPE_FUEL_TANK, TYPE_FUEL_TANK_IGNITE, TYPE_HEX_AERO_BOMB, TYPE_HEX_ARTILLERY, TYPE_HEX_BOMB, TYPE_HEX_CLEAR, TYPE_HEX_EXTINGUISH, TYPE_HEX_IGNITE, TYPE_HEX_SCREEN, TYPE_HEX_TAG, TYPE_I_NARC_POD, TYPE_MINEFIELD_CLEAR, TYPE_MINEFIELD_DELIVER, TYPE_SATURATION, TYPE_SEARCHLIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDemolitionCharge(int playerId, int damage, Coords pos) Demolition charges anchor to an absolute board hex, which only works for structures that cannot move.Add in any piloting skill modsvoidaddEquipment(Mounted<?> mounted, int loc, boolean rearMounted) Adds the given mounted equipment to the unit in the given location, possibly rear-facing depending on the given parameter.voidSets the internal structure for every location to appropriate undamaged values for the unit and location.boardToRelative(Coords boardCoords) Convert board coordinates to relative CubeCoordinates.booleanCan this entity change secondary facing at all?booleanbooleanReturns true when this unit can flee from the given position in its current state.booleanbooleanis it possible to go down, or are we landed/just above the water/treeline? assuming passed elevation.booleanDetermines if this entity can reinforce ongoing infantry vs infantry combat.intclipSecondaryFacing(int dir) Returns the closest valid secondary facing to the given direction.voidcollapseBasement(Coords coords, Board board, Vector<Report> vPhaseReport) voidcollapseFloorsOnHex(Coords coords, int numLevelsToCollapse) computeLayoutForPositionAndFacing(Coords testPosition, int testFacing) Deprecated, for removal: This API element is subject to removal in a future version.intgetArmor(int loc, boolean rear) Returns the amount of armor in the location specified, or IArmorState.ARMOR_NA, or IArmorState.ARMOR_DESTROYED.intintgetArmorTechLevel(int loc) intgetArmorType(int loc) getBasement(Coords coords) booleangetBasementCollapsed(Coords coords) Get the building basement, per TacOps rules.intGet the building class, per TacOps rules.intGet the facing/rotation of this building in board space.Get the board coordinates of this building's origin (where relative 0,0 maps to).Get the construction type of the building.intGet the coordinates that the building occupies.Returns a list of this Building's coords.doublegetCost(CalculationReport calcReport, boolean ignoreAmmo) Calculates and returns the C-bill cost of the unit.intgetCurrentCF(Coords coords) Get the current construction factor of the building hex at the passed coords.intlongintGet the height (BLDG_ELEV) of the building hex at the passed coords.Get the internal Building instance that stores data in relative coordinates.intgetInternalForReal(int loc) String[]String[]getName()Get the name of this building.intgetNCrew()Calculate building crew based on Advanced Building Minimum Crew Table (TO:AUE).int[]intintgetPhaseCF(Coords coords) Get the construction factor of the building hex at the passed coords at the start of the current phase.intGets the location that excess damage transfers to.getValidFacingsAt(Coords testPosition, int testElevation, int testBoardId) Returns all valid facings for this building at the given position and elevation.intgetWeaponArc(int weaponNumber) Returns the Rules.ARC that the weapon, specified by number, fires into.intgetWeaponFiringHeight(WeaponMounted weapon) What height is this weapon physically firing from?getWeaponFiringPosition(WeaponMounted weapon) WhatCoordsis this weapon physically firing from?booleanDetermines if the coord exist in the currentCF has.booleanbooleanDetermines if this entity can be boarded by infantry for interior combat.booleanDetermine if this building is on fire.booleanReturns TRUE if the entity meets the requirements for crippling damage as detailed in TW pg 258.booleanisCrippled(boolean checkCrew) Returns TRUE if the entity meets the requirements for crippling damage as detailed in TW pg 258.booleanReturns TRUE if the entity has been heavily damaged.booleanReturns TRUE if the entity has been lightly damaged.booleanReturns TRUE if the entity has been moderately damaged.booleanisLocationProhibited(Coords testPosition, int testBoardId, int testElevation) Returns true when the given location cannot legally be entered or deployed into by this unit at the given elevation or altitude.booleanChecks if the unit is hardened against nuclear strikes.booleanisPositionAndFacingValid(Coords testPosition, int testFacing, int testElevation, int testBoardId) Checks if all hexes of this building would be valid at the given position and facing WITHOUT modifying the entity's state.booleanDetermine if the unit can be repaired, or only harvested for spares.booleanBuildings are salvageable unless they have completely collapsed.booleanisSecondaryArcWeapon(int weaponId) Returns true if this weapon fires into the secondary facing arc.booleanReturns true if this entity is targetable for attacks.booleanisValidSecondaryFacing(int dir) Can this entity torso/turret twist the given direction?intReturns the number of locations in the entityvoidvoidrelativeToBoard(CubeCoords relativeCoords) Convert relative CubeCoordinates to board coordinates.voidvoidRemove one building hex from the buildingbooleanrollBasement(Coords coords, Board board, Vector<Report> vPhaseReport) Roll what kind of basement this building hasrollHitLocation(int table, int side) Rolls up a hit locationrollHitLocation(int table, int side, int aimedLocation, AimingMode aimingMode, int cover) Rolls the to-hit numbervoidvoidsetBasement(Coords coords, BasementType basement) voidsetBasementCollapsed(Coords coords, boolean collapsed) voidsetBurning(boolean onFire, Coords coords) Set the flag that indicates that this building is on fire.voidsetCurrentCF(int cf, Coords coords) Set the current construction factor of the building hex.voidsetDemolitionCharges(List<DemolitionCharge> charges) voidsetFacing(int facing) Sets the primary facing.voidSet the height of a specific building hex.voidsetInternal(int val, int loc) Override to keep entity internal and building CF synchronized.voidsetPhaseCF(int cf, Coords coords) Set the construction factor of the building hex for the start of the next phase.voidsetPosition(Coords position) Override setPosition to populate the relativeLayout map when the entity is placed.voidsetPosition(Coords position, boolean gameUpdate) Sets the current position of this entity on the board.intvoidupdateBuildingEntityHexes(int boardId, TWGameManager gameManager) Once a building entity has set its position, we need to update the board itself and share that with the clientsCalculates a "generic" Battle Value that is based on the average of all units of this type and tonnage.Methods inherited from class megamek.common.units.Entity
activateRadicalHS, addAttackedByThisTurn, addBeenDetectedBy, addBeenSeenBy, addBomb, addBomb, addClanCase, addConditionBonuses, addCoolantFailureAmount, addCritical, addCritical, addCritical, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addFailedEquipment, addFiringSolution, addGhostTargetDefensiveBonus, addGhostTargetOffensiveBonus, addGroundAttackedByThisTurn, addIMPHits, addIntrinsicTransporters, addKill, addOffBoardObserver, addPassedThrough, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addRoofRack, addSensorContact, addSystemTechAdvancement, addTargetedBySwarm, addTechComponent, addTowedUnit, addTransporter, addTransporter, addTsempHitThisTurn, addWeaponGroup, antiTSMVulnerable, applyDamage, applyGravityEffectsOnMP, applyMagneticPulse, armorStringFor, assignAMS, assignTMAMS, assignWeaponQuirk, attachINarcPod, attachNarcPod, braceLocation, C3MasterIs, calcElevation, calcElevation, calculateBattleValue, calculateBattleValue, calculateBattleValue, calculateBattleValue, calculateFreeC3MNodes, calculateFreeC3Nodes, canActivateBloodStalker, canAnnounceAbandon, canAssaultDrop, canAssist, canBePickedUp, canBrace, canDFA, canEjectCrew, canEscape, canFall, canFall, canFireWeapon, canFlee, canFleeFrom, canFleeInState, canFlipArms, canGoHullDown, canGoUp, canHide, canInitiateInfantryVsInfantryCombat, canLayDemolitionCharges, canLayMine, canLoad, canLoad, canLoad, canonUnitWithInvalidBuild, canPerformGroundSalvageOperations, canPerformSpaceSalvageOperations, canPickupCarryableObject, canPickupGroundObject, canRam, canShutdownEi, canSpot, canTow, canTransferCriticalSlots, canUnjamRAC, canUnstickByJumping, changeHeatBuildup, checkBogDown, checkDislodgeSwarmers, checkForMASCFailure, checkForSuperchargerFailure, checkGetUp, checkGunningIt, checkLandingInHeavyWoods, checkLandingOnBlackIce, checkLandingOnIce, checkLandingWithDamage, checkLandingWithPrototypeJJ, checkMovedTooFast, checkMovementInBuilding, checkRecklessMove, checkRubbleMove, checkRunningWithDamage, checkSideSlip, checkSkid, checkSprintingWithMASCAndSupercharger, checkSprintingWithMASCXorSupercharger, checkTurnModeFailure, checkUnstall, checkUsingOverdrive, checkWaterMove, checkWaterMove, chooseSide, clearAttackedByThisTurn, clearBombs, clearDestroyedNarcPods, clearDetectedBy, clearFiringSolutions, clearHeatBreakdown, clearInfantryCombatState, clearNarcAndiNarcPods, clearPartialRepairs, clearSeenBy, clearSensorContacts, climbMode, countEquipment, countForStrengthSum, countMisc, countPartialRepairs, countQuirks, countQuirks, countWeaponQuirks, countWorkingMisc, countWorkingMisc, countWorkingMisc, crewCanLeave, critStateCount, damage, damageBayDoor, damagedJumpJets, damageDockCollar, damageDoorRecovery, damagedSCMCritCount, damageSystem, damageSystem, deactivateRadicalHS, deployOffBoard, destroy, destroyLocation, destroyLocation, destroyOneSearchlight, destroyRetractableBlade, disconnectUnit, doBattleValueCalculation, doCheckEngineStallRoll, doomedInAtmosphere, doomedInExtremeTemp, doomedInSpace, doomedInVacuum, doomedOnGround, dropCarriedObject, dropCarriedObject, dropGroundObjects, elevationOccupied, elevationOccupied, endOfTurnCargoInteraction, entityIsQuad, equals, extendBlade, factionTechLevel, findTargetedDisplacement, firstArmorIndex, fixElevation, formatHeat, gameOptions, generalName, generateDisplayName, generateShortName, getAbandonmentAnnouncedRound, getActiveAMS, getActiveSensor, getActiveSubEntities, getActiveUMUCount, getActiveVibrobladeHeat, getActiveVibrobladeHeat, getAllGyroCodeName, getAllowedPhysicalAttacks, getAllTowedUnits, getAllUMUCount, getAlreadyTwisted, getAlternateCost, getAltitude, getAmmo, getAmmo, getAmmo, getAnyTypeMaxJumpMP, getArmedMPBoosters, getArmor, getArmor, getArmoredComponentTechAdvancement, getArmorForReal, getArmorForReal, getArmorRemainingPercent, getArmorString, getArmorString, getArmorTechRating, getArmorWeight, getArmorWeight, getArmsFlipped, getASEWAffected, getAttackedByThisTurn, getAttackingEntity, getBadCriticalSlots, getBAPRange, getBARRating, getBase64Icon, getBaseAvailability, getBaseChassisFireConWeight, getBaseChassisValue, getBaseEngineValue, getBasePilotingRoll, getBasePilotingRoll, getBay, getBayByAmmo, getBayById, getBayLoadedUnitIds, getBayPersonnel, getBlockedFiringLocations, getBloodStalkerTarget, getBlueShieldRounds, getBoardId, getBoardLocation, getBodyLocation, getBombLoadout, getBombLoadout, getBombs, getBombs, getBoobyTrap, getBoobyTrapDamage, getBraceMPCost, getBvCalculator, getC3ecmAffected, getC3iNextUUIDAsString, getC3Master, getC3MasterId, getC3MasterIsUUIDAsString, getC3NetId, getC3Top, getC3UUIDAsString, getCamouflage, getCamouflageOrElse, getCamouflageOrElse, getCamouflageOrElseOwners, getCargoMpReduction, getCarriedObject, getCarriedObjects, getChassis, getClanChassisName, getClimbingLevelsChosen, getClubs, getCollarById, getCommonDate, getCommonDateRange, getConnectedUnits, getConsecutiveRHSUses, getConstructionTechAdvancement, getConversionMode, getCoolantFailureAmount, getCost, getCrew, getCritical, getCriticalSlots, getCustomWeaponOrder, getCustomWeaponOrder, getDamagedCriticalSlots, getDamageLevel, getDamageLevel, getDamageReductionFromModularArmor, getDefaultPickupLocations, getDependentLocation, getDeployRound, getDisplacementAttack, getDisplayName, getDistinctCarriedObjects, getDockingCollars, getDocks, getDocks, getDropCargoLocationMap, getDroppableUnits, getDuplicateMarker, getEarliestTechDate, getEarliestTechDateAndEra, getECCMInfo, getECCMStrength, getECMInfo, getECMRange, getECMStrength, getElevation, getEMPInterferenceRounds, getEMPShutdownRounds, getEmptyCriticalSlots, getEngine, getEngineCritHeat, getEngineTechRating, getEngineType, getEntityMajorTypeName, getEntityTypeName, getEquipment, getEquipment, getEquipmentForWeaponQuirk, getEquipmentNum, getEquipmentType, getEvasionBonus, getExteriorUnitAt, getExternalBombLoadout, getExternalId, getExternalIdAsString, getExternalUnits, getExtinctionDate, getExtinctionDate, getExtinctionRange, getExtraC3BV, getExtraCommGearTons, getExtremeRangeModifier, getFacing, getFacingName, getFailedEquipment, getFighterBays, getFiringSolutions, getFleeZone, getFluff, getFluffImage, getForceGeneratorAvailability, getForceId, getForceString, getForwardArc, getFreeC3iUUID, getFreeNC3UUID, getFullChassis, getGame, getGaveKillCredit, getGenericBattleValue, getGhostTargetDefensiveBonus, getGhostTargetOffensiveBonus, getGhostTargetOverride, getGhostTargetRoll, getGhostTargetRollMoS, getGoodCriticalSlots, getGrappled, getGrappleSide, getGroundAttackedByThisTurn, getGyroType, getHeading, getHeat, getHeatBreakdown, getHeatCapacity, getHeatCapacity, getHeatCapacityWithWater, getHeatFiringModifier, getHeatInArc, getHeatMPReduction, getHeight, getHiddenActivationPhase, getHitchCarrying, getHitchLocations, getHitCriticalSlots, getHittableCriticalSlots, getHQIniBonus, getIcon, getId, getImpLastTurn, getImpMpReduction, getImpToHitModifier, getINarcPodsAttached, getIndividualWeaponList, getInfantryCombatTargetId, getInfantryCombatTurnCount, getInitialBV, getInternal, getInternal, getInternalBombLoadout, getInternalRemainingPercent, getInternalString, getIntroductionDate, getIntroductionDate, getIntroductionDateAndEra, getInvalidSourceBuildReasons, getIsJumpingNow, getJumpHeat, getJumpMP, getJumpMP, getJumpMPWithTerrain, getJumpType, getKillerId, getKillNumber, getKills, getLabArmorTonnage, getLabTotalArmorPoints, getLastTarget, getLastTargetDisplayName, getLaunchableDropships, getLaunchableFighters, getLaunchableSmallCraft, getLoadedKeepers, getLoadedTrailers, getLoadedUnits, getLocationAbbr, getLocationAbbr, getLocationDamage, getLocationFromAbbr, getLocationName, getLocationName, getLocationStatus, getLongRangeModifier, getLOSRangeModifier, getMagneticPulseRounds, getManualBV, getMASC, getMASCTarget, getMASCTurns, getMaxElevationChange, getMaxElevationDown, getMaxElevationDown, getMaxWeaponRange, getMaxWeaponRange, getMechanicalJumpBoosterMP, getMechanicalJumpBoosterMP, getMediumRangeModifier, getMisc, getMisc, getMiscEquipment, getMissionRoles, getMixedTechAdvancement, getModel, getMotiveSideMod, getMovedBackwards, getMovementAbbr, getMovementBeforeSkidPSRModifier, getMovementMode, getMovementModeAsString, getMovementString, getMPBoosters, getMPBoosters, getMpUsedLastRound, getMulId, getNC3NextUUIDAsString, getNeuralInterfaceMode, getNewRoundNovaNetworkString, getNextSensor, getNMarines, getNPassenger, getNumberOfCriticalSlots, getNumberOfCriticalSlots, getNumberOfCriticalSlots, getNumberOfCriticalSlots, getNumberOfShields, getOArmor, getOArmor, getOArmor, getObsoleteQuirkValue, getObsoleteRepairModifier, getObsoleteResaleModifier, getObsoleteYear, getObsoleteYearForModifiers, getObsoleteYears, getOccupiedCoords, getOccupiedHex, getOffBoardDirection, getOffBoardDistance, getOInternal, getOInternal, getOmniAdvancement, getOmniAdvancement, getOriginalBuildYear, getOriginalChassis, getOriginalJumpMP, getOriginalJumpMP, getOriginalModel, getOriginalNovaC3NetId, getOriginalRunMP, getOriginalUnitFileUUID, getOriginalWalkMP, getOwner, getOwnerId, getPartialRepairs, getPassedThrough, getPassedThroughBoardId, getPassedThroughFacing, getPassengerCapacityWithoutBayCrew, getPatchworkArmorAdvancement, getPendingVariableRangeTargetingMode, getPickedUpMekWarriors, getPickupLocationMap, getPlayerPickedPassThrough, getPodMountedTroopCarryingSpace, getPosition, getPowerAmplifierWeight, getPriceMultiplier, getPriorPosition, getProductionDate, getProductionDate, getProductionDateRange, getPrototypeDate, getPrototypeDate, getPrototypeRangeDate, getPublished, getPublishedSources, getQuirkIniBonus, getQuirkList, getQuirks, getRearArc, getRecoveryTime, getRecoveryTurn, getReintroductionDate, getReintroductionDate, getRemovalCondition, getRetreatedDirection, getRole, getRunHeat, getRunMP, getRunMP, getRunMPasString, getRunMPasString, getRunMPWithoutMASC, getRunningGravityLimit, getsAutoExternalSearchlight, getSearchlightOverride, getSecondaryFacing, getSecondaryPositions, getSelfDestructedThisTurn, getSelfDestructing, getSelfDestructInitiated, getSensorCheck, getSensorContacts, getSensors, getShortName, getShortNameRaw, getShortRangeModifier, getSource, getSources, getSpotTargetId, getSprintHeat, getSprintMP, getSprintMP, getSprintMPWithOneMASC, getSprintMPWithoutMASC, getSpriteDrawPriority, getStandingHeat, getStartingAnyNWx, getStartingAnyNWx, getStartingAnyNWy, getStartingAnyNWy, getStartingAnySEx, getStartingAnySEx, getStartingAnySEy, getStartingAnySEy, getStartingOffset, getStartingOffset, getStartingPos, getStartingPos, getStartingWidth, getStartingWidth, getStaticTechLevel, getStealthModifier, getStrength, getStructuralTechRating, getStructureTechLevel, getStructureType, getSubEntities, getSuperCharger, getSuperchargerTarget, getSuperchargerTurns, getSwarmAttackerId, getSwarmTargetId, getTaggedBy, getTargetBay, getTargetedBySwarm, getTargetType, getTaserFeedBackRounds, getTaserInterference, getTaserInterferenceHeat, getTaserInterferenceRounds, getTaserShutdownRounds, getTCPInitiativeBonus, getTechBase, getTechBaseDescription, getTechBaseDescriptions, getTechFaction, getTechLevel, getTechLevelYear, getTechLevelYears, getTechRating, getTilesetModeString, getTMTracker, getTonnage, getTotalAmmoOfType, getTotalArmor, getTotalInternal, getTotalMunitionsOfType, getTotalOArmor, getTotalOInternal, getTotalWeaponList, getTowedBy, getTowing, getTractor, getTraitorId, getTransferLocation, getTransportBays, getTransportId, getTransports, getTroopCarryingSpace, getTrooperAtLocation, getTsempEffect, getTsempHitsThisTurn, getUnitFileUUID, getUnitNumber, getUnitsUnloadableFromBays, getUnitsUnloadableFromNonBays, getUnitType, getUnloadableUnits, getUnused, getUnused, getUnusedString, getUnusedString, getUseManualBV, getValidBraceLocations, getValidHalfWeightPickupLocations, getVariableRangeTargetingMode, getVariableRangeTargetingModifier, getVector, getVectors, getVelocity, getVibroClaws, getWalkHeat, getWalkMP, getWalkMP, getWeapon, getWeaponBayList, getWeaponGroupList, getWeaponList, getWeaponListWithHHW, getWeapons, getWeaponSortOrder, getWeight, getWeightClass, getWeightClassName, getWhoCanDetect, getWhoCanSee, getYear, hasAbility, hasAbility, hasActivatedRadicalHS, hasActiveBlueShield, hasActiveDNI, hasActiveECCM, hasActiveECM, hasActiveECM, hasActiveEiCockpit, hasActiveNovaCEWS, hasAimModeTargComp, hasAnyC3System, hasAnyTypeNarcPodsAttached, hasArcFired, hasArmoredChassis, hasArmoredEngine, hasArtillery, hasBadLegs, hasBAP, hasBAP, hasBARArmor, hasBattleArmorHandles, hasBoobyTrap, hasBoostedC3, hasC3, hasC3i, hasC3M, hasC3MM, hasC3S, hasCase, hasCASEII, hasCASEII, hasCommandConsoleBonus, hasDamagedRHS, hasDetectedEntity, hasDisplacementAttack, hasDNICockpitMod, hasDNIImplant, hasDNIInducedHardToPilot, hasDroneOs, hasECM, hasEiCockpit, hasEmbeddedIcon, hasEMPInterferenceHeat, hasEngine, hasEntityScopedPreEndDeclaration, hasEnvironmentalSealing, hasETypeFlag, hasExternalSearchlight, hasFallen, hasFiredTsemp, hasFiringSolutionFor, hasFleeZone, hasFlotationHull, hasFrontMountedBulldozer, hasFrontMountedSaw, hasFunctionalArmAES, hasFunctionalLegAES, hasGhostTargetEquipment, hasGhostTargets, hasHardenedArmor, hasHarJelIn, hashCode, hasHierarchicalC3, hasHipCrit, hasINarcPodsAttached, hasInfernoAmmo, hasLegActuatorCrit, hasLinkedMGA, hasLoweredShield, hasLoweredShield, hasMinesweeper, hasMisc, hasMisc, hasMisc, hasModularArmor, hasModularArmor, hasMulId, hasNarcPodsAttached, hasNavalC3, hasNhC3, hasNoDefenseShield, hasNovaCEWS, hasObsoleteQuirk, hasOccupiedHex, hasOriginalBuildYear, hasPatchworkArmor, hasQuirk, hasRaisedShield, hasRaisedShield, hasRearArmor, hasRearMountedBulldozer, hasRHSWentUp, hasSCM, hasSearchlight, hasSeenEntity, hasSensorContactFor, hasShield, hasSystem, hasTAG, hasTargComp, hasTCPAimedShotCapability, hasUMU, hasUndamagedCriticalSlots, hasUnloadedUnitsFromBays, hasUsedRHSLastTurn, hasVariableRangeTargeting, hasViableWeapons, hasVibroblades, hasWorkingBackhoe, hasWorkingBulldozer, hasWorkingMisc, hasWorkingMisc, hasWorkingMisc, hasWorkingMisc, hasWorkingRadicalHS, hasWorkingSCM, hasWorkingSystem, height, hitAllCriticalSlots, implicitClanCASE, incrementInfantryCombatTurnCount, incrementMASCAndSuperchargerLevels, initializeArmor, initializeInternal, initMilitary, initTechAdvancement, isAbandoned, isActive, isActive, isActiveOption, isAeroLandedOnGroundMap, isAeroSensorDestroyed, isAirborne, isAirborneAeroOnGroundMap, isAirborneVTOLorWIGE, isAssaultDropInProgress, isAttackingThisTurn, isBATaserShutdown, isBoardProhibited, isBoardProhibited, isBoobyTrapInitiated, isBracing, isC3CompanyCommander, isC3IndependentMaster, isCanon, isCapitalFighter, isCapitalFighter, isCapitalScale, isCaptured, isCarcass, isCarefulStand, isCarryableObject, isChainWhipGrappled, isChameleonShieldActive, isChameleonShieldOn, isCharging, isChassisFamiliarityEligible, isClan, isClanArmor, isClearingMinefield, isClearingWoods, isClimbing, isCommander, isConvertingNow, isDangling, isDeployed, isDesignValid, isDestroyed, isDetectedByEnemy, isDone, isDoomed, isDropping, isEiShutdown, isEjectionPossible, isElevationValid, isEligibleFor, isEligibleForArtyAutoHitHexes, isEligibleForFiring, isEligibleForInfantryVsInfantry, isEligibleForMovement, isEligibleForOffboard, isEligibleForPavementOrRoadBonus, isEligibleForPhysical, isEligibleForPreEndDeclarations, isEligibleForTargetingPhase, isEnemyOf, isEvading, isEverSeenByEnemy, isFindingClub, isFiredTsempThisTurn, isFirefighter, isGhostTargetCapable, isGrappleAttacker, isGrappledThisRound, isGyroDestroyed, isHardenedArmorDamaged, isHidden, isHullDown, isIlluminated, isImmobile, isImmobile, isImmobileForJump, isImpEcmAffected, isINarcedBy, isINarcedWith, isInBuilding, isInDemolishableStructureHex, isInfantryCombatAttacker, isInfantryCombatWantsWithdrawal, isIntroLevel, isInvulnerable, isJumpingWithMechanicalBoosters, isLargeCraft, isLayingMines, isLoadableThisTurn, isLocationBad, isLocationBlownOff, isLocationBlownOffThisPhase, isLocationDeadly, isLocationDeadly, isLocationDoomed, isLocationProhibited, isLocationProhibited, isLocationProhibited, isLocationProhibited, isLocationTrulyDestroyed, isMakingDfa, isMakingVTOLGroundAttack, isManualShutdown, isMASCUsed, isMilitary, isMixedTech, isNarcedBy, isNaval, isNeuralInterfaceEnabled, isNeuralInterfaceFullTracking, isNightwalker, isNOE, isNonCanonBySource, isNonCanonBySource, isNotCrewedEntityType, isNullSigActive, isNullSigOn, isObsoleteInYear, isOffBoard, isOffBoardObserved, isOmni, isOnAtmosphericGroundMap, isPartOfFighterSquadron, isPendingAbandon, isPermanentlyImmobilized, isPodMountedTransport, isPowerReverse, isPrimitive, isProne, isPushing, isRamming, isReckless, isSelectableThisTurn, isSensorReturn, isShutDown, isShutDownThisPhase, isSpaceborne, isSpotting, isStalled, isStartupThisPhase, isStealthActive, isStealthOn, isStuck, isSufferingEMI, isSuperchargerUsed, isSuperHeavy, isSurfaceNaval, isTargetOfDisplacementAttack, isTractor, isTrailer, isTransported, isTrapped, isUncrewed, isUnderwater, isUnjammingRAC, isUnloadedThisTurn, isUnofficial, isUsingManAce, isUsingSearchlight, isVisibleToEnemy, isVoidSigActive, isVoidSigOn, isWeaponBlockedAt, isWeaponBlockedByTowing, isWeaponOrderChanged, isWeaponValidForPhase, itemOppositeTech, joinLocationAbbr, load, load, load, load, loadAllWeapons, loadDefaultCustomWeaponOrder, loadedUnitsHaveActiveECM, loadQuirks, loadWeapon, loadWeapon, loadWeaponWithSameAmmo, loadWeaponWithSameAmmo, locationHasCase, locationIsLeg, madePointblankShot, maxGroundObjectTonnage, modifyPhysicalDamageForMeleeSpecialist, needsRollToStand, newPhase, newRound, newRoundNovaNetSwitch, newRoundVariableRangeSwitch, nextConversionMode, onSameC3NetworkAs, onSameC3NetworkAs, ownerHasDemolitionCharge, passedOver, passedThrough, passedThroughPrevious, passedWithin, performManualShutdown, performManualStartup, pickUp, pickupCarryableObject, postProcessFacingChange, processPickupStep, processPickupStepEntity, recalculateTechAdvancement, recordedTechLevel, recover, regenerateUnitFileUUID, relHeight, reloadEmptyWeapons, removeAllINarcPods, removeAllTransporters, removeCriticalSlots, removeFiringSolution, removeINarcPod, removeMisc, removePartialCoverHits, removeSensorContact, removeTowedUnit, removeTransporter, resetBayDoors, resetBays, resetBombAttacks, resetCoolantFailureAmount, resetFiringArcs, resetPickedUpMekWarriors, resetTransporter, restore, rollMovementInBuilding, scmCritStateCount, setAbandonmentAnnouncedRound, setAlreadyTwisted, setAltitude, setArcFired, setArmor, setArmor, setArmor, setArmorTechLevel, setArmorTechLevel, setArmorTechRating, setArmorTechRating, setArmorTonnage, setArmorType, setArmorType, setArmorType, setArmorType, setArmsFlipped, setArmsFlipped, setASEWAffected, setAssaultDropInProgress, setBARRating, setBARRating, setBaseChassisFireConWeight, setBATaserShutdown, setBloodStalkerTarget, setBoardId, setBoobyTrapInitiated, setBraceLocation, setC3ecmAffected, setC3iNextUUIDAsString, setC3Master, setC3Master, setC3MasterIsUUIDAsString, setC3NetId, setC3NetId, setC3NetIdSelf, setC3UUID, setC3UUIDAsString, setCamouflage, setCanon, setCanUnstickByJumping, setCaptured, setCarcass, setCarefulStand, setCarriedObjects, setChassis, setClanChassisName, setClearingMinefield, setClearingWoods, setClimbing, setClimbingLevelsChosen, setClimbMode, setCommander, setConsecutiveRHSUses, setConversionMode, setConvertingNow, setCrew, setCritical, setCustomWeaponOrder, setCustomWeaponOrder, setDangling, setDeployed, setDeployRound, setDesignValid, setDestroyed, setDetectedByEnemy, setDisplacementAttack, setDisplayName, setDone, setDoomed, setDuplicateMarker, setEiShutdown, setElevation, setEMI, setEMPInterference, setEMPShutdownRounds, setEngine, setEngineTechRating, setEngineTechRating, setEvading, setEverSeenByEnemy, setExternalId, setExternalIdAsString, setExternalSearchlight, setFallen, setFindingClub, setFiredTsempThisTurn, setFleeZone, setForceGeneratorAvailability, setForceId, setForceString, setGame, setGameOptions, setGrappled, setGrappledThisRound, setGrappleSide, setHardenedArmorDamaged, setHasDamagedRHS, setHasFiredTsemp, setHidden, setHiddenActivationPhase, setHullDown, setIcon, setId, setIGame, setIlluminated, setImpLastTurn, setInfantryCombatAttacker, setInfantryCombatTargetId, setInfantryCombatTurnCount, setInfantryCombatWantsWithdrawal, setInitialBV, setInternal, setInvalidSourceBuildReasons, setIsJumpingNow, setJumpingWithMechanicalBoosters, setLandedAssaultDrop, setLastTarget, setLastTargetDisplayName, setLayingMines, setLoadedKeepers, setLoadedThisTurn, setLocationBlownOff, setLocationBlownOffThisPhase, setLocationStatus, setLocationStatus, setMadePointblankShot, setMagneticPulseHit, setManualBV, setManualShutdown, setMASCUsed, setMissionRoles, setMixedTech, setModel, setMovedBackwards, setMovementMode, setMulId, setNC3NextUUIDAsString, setNCrew, setNeverDeployed, setNewRoundNovaNetworkString, setNextSensor, setNMarines, setNPassenger, setOffBoard, setOmni, setOriginalBuildYear, setOriginalJumpMP, setOriginalWalkMP, setOwner, setOwnerId, setPassedThrough, setPassedThroughBoardId, setPassedThroughFacing, setPendingAbandon, setPendingVariableRangeTargetingMode, setPlayerPickedPassThrough, setPowerReverse, setProne, setPublished, setPublishedSources, setQuirks, setRamming, setRapidFire, setReckless, setRecoveryTurn, setRemovalCondition, setRetreatedDirection, setSalvage, setSearchlightOverride, setSearchlightState, setSecondaryFacing, setSecondaryFacing, setSelfDestructedThisTurn, setSelfDestructing, setSelfDestructInitiated, setShutDown, setShutDownThisPhase, setSource, setSources, setSpotTargetId, setSpotting, setStartingAnyNWx, setStartingAnyNWy, setStartingAnySEx, setStartingAnySEy, setStartingOffset, setStartingPos, setStartingWidth, setStartupThisPhase, setStruck, setStructuralTechRating, setStructuralTechRating, setStructureTechLevel, setStructureType, setStructureType, setStuck, setSuperchargerUsed, setSwarmAttackerId, setSwarmTargetId, setTaggedBy, setTargetBay, setTaserFeedback, setTaserInterference, setTaserShutdownRounds, setTechFaction, setTechLevel, setTowedBy, setTowing, setTractor, setTraitorId, setTransportId, setTsempEffect, setTurnInterrupted, setUnitFileUUID, setUnitNumber, setUnitRole, setUnjammingRAC, setUnloaded, setUsedRHSLastTurn, setUsedSearchlight, setUseManualBV, setVariableRangeTargetingMode, setVectors, setVisibleToEnemy, setWeaponHit, setWeaponOrderChanged, setWeaponSortOrder, setWeight, setWhoCanDetect, setWhoCanSee, setWigeLiftoffHover, setYear, shouldDeploy, shouldOffBoardDeploy, shouldUseEdge, sideTable, sideTable, sideTable, sideTableRam, sideTableRam, slotNumber, specificName, statusToString, statusToString, statusToString, storeOriginalUnitData, storeSavedUnitData, taserShutdown, toggleConversionMode, toString, towUnit, turnWasInterrupted, unload, updateBays, updateDuplicateMarkerAfterDelete, usedSearchlight, usedTag, usesTurnMode, usesWeaponBays, wasLoadedThisTurn, wasNeverDeployed, wasStruck, weaponFired, weaponFiredFrom, whichBay, wigeLiftoffHoverMethods inherited from class megamek.common.turns.TurnOrdered
clearInitiative, generateTurnOrder, getAeroTurns, getDropshipTurns, getEvenTurns, getInitCompensationBonus, getInitiative, getJumpshipTurns, getMultiTurns, getNormalTurns, getOtherTurns, getSmallCraftTurns, getSpaceStationTurns, getTeleMissileTurns, getWarshipTurns, incrementAeroTurns, incrementDropshipTurns, incrementEvenTurns, incrementJumpshipTurns, incrementMultiTurns, incrementOtherTurns, incrementSmallCraftTurns, incrementSpaceStationTurns, incrementTeleMissileTurns, incrementWarshipTurns, resetAeroTurns, resetDropshipTurns, resetEvenTurns, resetInitiativeCompensation, resetJumpshipTurns, resetMultiTurns, resetOtherTurns, resetSmallCraftTurns, resetSpaceStationTurns, resetTeleMissileTurns, resetWarshipTurns, rollInitAndResolveTies, rollInitAndResolveTies, rollInitiative, rollInitiative, setInitCompensationBonus, setInitiativeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface megamek.common.units.BTObject
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, isWarShipMethods inherited from interface megamek.common.interfaces.CombatRole
hasRoleMethods inherited from interface megamek.common.interfaces.ForceAssignable
partOfForceMethods inherited from interface megamek.common.units.IBuilding
getAbsorption, getBoardId, getDamageFromScale, getDamageReductionFromOutside, getDamageToScale, getId, getInfDmgFromInside, isIn, setBoardIdMethods inherited from interface megamek.common.equipment.ICarryable
getCarriedObjectDamageAllocation, targetForArmHitToHitCarriedObjectMethods inherited from interface megamek.common.game.InGameObject
hasOwnerMethods inherited from interface megamek.common.interfaces.ITechnology
calcEraAvailability, calcEraAvailability, calcYearAvailability, calcYearAvailability, calcYearAvailability, findMinimumRulesLevel, findMinimumRulesLevel, getAdvancedRange, getAdvancedRange, getCodeFromIOAbbr, getCodeFromMMAbbr, getCommonDate, getEraAvailabilityName, getEraAvailabilityName, getExperimentalRange, getExperimentalRange, getExtinctionDate, getExtinctionRange, getFullRatingName, getFullRatingName, getIntroductionDate, getProductionDate, getPrototypeDate, getReintroductionDate, getSimpleLevel, getSimpleLevel, getSimpleLevel, getStandardRange, getStandardRange, getTechLevel, getTechLevel, getTechRatingName, isAvailableIn, isAvailableIn, isAvailableIn, isExtinct, isExtinct, isExtinct, isLegal, isLegalMethods inherited from interface megamek.common.units.Targetable
isBomber, isBuildingEntityOrGunEmplacement, isHexBeingBombed, isOnBoard, tracksHeatMethods inherited from interface megamek.common.equipment.Transporter
alwaysDamageCargoIfTransportHit, canTow, getCarryables, getNameForRecordSheets, getNumberLoadedThisTurn, getNumberUnloadedThisTurn, getTransporterType, hardpointCost, setEntity
-
Field Details
-
HIT_LOCATION_NAMES
-
-
Constructor Details
-
AbstractBuildingEntity
-
-
Method Details
-
defaultCrewType
- Overrides:
defaultCrewTypein classEntity
-
getBoardOrigin
Description copied from interface:IBuildingGet the board coordinates of this building's origin (where relative 0,0 maps to). For BuildingTerrain: the static placement coords For AbstractBuildingEntity: the entity's current position- Specified by:
getBoardOriginin interfaceIBuilding- Returns:
- the board coordinates of the origin, or null if not placed
-
getBoardFacing
public int getBoardFacing()Description copied from interface:IBuildingGet the facing/rotation of this building in board space. 0 = north, 1-5 = clockwise rotation- Specified by:
getBoardFacingin interfaceIBuilding- Returns:
- the facing (0-5)
-
getInternalBuilding
Description copied from interface:IBuildingGet the internal Building instance that stores data in relative coordinates. Building returns itself; BuildingTerrain/BuildingEntity override to return wrapped instance.- Specified by:
getInternalBuildingin interfaceIBuilding- Returns:
- the internal Building instance
-
boardToRelative
Description copied from interface:IBuildingConvert board coordinates to relative CubeCoordinates. Default: convert board Coords to CubeCoords. BuildingTerrain/BuildingEntity override to translate using their coord maps.- Specified by:
boardToRelativein interfaceIBuilding- Parameters:
boardCoords- the board coordinates- Returns:
- the relative CubeCoordinates
-
relativeToBoard
Description copied from interface:IBuildingConvert relative CubeCoordinates to board coordinates. Default: convert CubeCoords to offset Coords. BuildingTerrain/BuildingEntity override to translate using their coord maps.- Specified by:
relativeToBoardin interfaceIBuilding- Parameters:
relativeCoords- the relative CubeCoordinates- Returns:
- the board coordinates
-
getWeaponFiringPosition
Description copied from class:EntityWhatCoordsis this weapon physically firing from?- Overrides:
getWeaponFiringPositionin classEntity- Parameters:
weapon-WeaponMounted- Returns:
Coords
-
getWeaponFiringHeight
Description copied from class:EntityWhat height is this weapon physically firing from?- Overrides:
getWeaponFiringHeightin classEntity- Parameters:
weapon-WeaponMounted- Returns:
- int
-
setPosition
Override setPosition to populate the relativeLayout map when the entity is placed. This establishes the mapping between the building's internal relative coordinates and their actual board coordinates.- Overrides:
setPositionin classEntity
-
setPosition
Description copied from class:EntitySets the current position of this entity on the board.- Overrides:
setPositionin classEntity- Parameters:
position- the new position.
-
isLocationProhibited
Returns true when the given location cannot legally be entered or deployed into by this unit at the given elevation or altitude. Also returns true when the location doesn't exist. Even when this method returns true, the location need not be deadly to the unit.- Overrides:
isLocationProhibitedin classEntity- Parameters:
testPosition- The position to testtestBoardId- The board to testtestElevation- The elevation or altitude to test- Returns:
- True when the location is illegal to be in for this unit, regardless of elevation
- See Also:
-
computeLayoutForPositionAndFacing
@Deprecated(since="0.51.0", forRemoval=true) public Map<CubeCoords,Coords> computeLayoutForPositionAndFacing(Coords testPosition, int testFacing) Deprecated, for removal: This API element is subject to removal in a future version.Computes what the relative layout would be for a hypothetical position and facing WITHOUT modifying the entity's actual position or facing. This is a pure calculation method with no side effects.- Parameters:
testPosition- The position to testtestFacing- The facing to test (0-5)- Returns:
- Map of relative CubeCoords to their board Coords at the given position/facing
-
isPositionAndFacingValid
public boolean isPositionAndFacingValid(Coords testPosition, int testFacing, int testElevation, int testBoardId) Checks if all hexes of this building would be valid at the given position and facing WITHOUT modifying the entity's state. This is a pure calculation method.- Parameters:
testPosition- The position to testtestFacing- The facing to test (0-5)testElevation- The elevation to testtestBoardId- The board ID to test- Returns:
- true if all building hexes would be valid at this position/facing
-
getValidFacingsAt
Returns all valid facings for this building at the given position and elevation. Does NOT modify the entity's facing - this is a pure calculation method.- Parameters:
testPosition- The position to testtestElevation- The elevation to testtestBoardId- The board ID to test- Returns:
- List of valid facings (0-5), or empty list if none valid
-
locations
public int locations()Returns the number of locations in the entity -
refreshAdditionalLocations
public void refreshAdditionalLocations() -
setFacing
public void setFacing(int facing) Sets the primary facing. -
canChangeSecondaryFacing
public boolean canChangeSecondaryFacing()Can this entity change secondary facing at all?- Specified by:
canChangeSecondaryFacingin classEntity
-
isValidSecondaryFacing
public boolean isValidSecondaryFacing(int dir) Can this entity torso/turret twist the given direction?- Specified by:
isValidSecondaryFacingin classEntity
-
clipSecondaryFacing
public int clipSecondaryFacing(int dir) Returns the closest valid secondary facing to the given direction.- Specified by:
clipSecondaryFacingin classEntity- Returns:
- the closest valid secondary facing.
-
getLocationNames
- Specified by:
getLocationNamesin classEntity
-
getLocationAbbreviations
- Specified by:
getLocationAbbreviationsin classEntity
-
sideTable
- Specified by:
sideTablein interfaceTargetable- Overrides:
sideTablein classEntity- Returns:
- side hit from location
-
rollHitLocation
public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMode aimingMode, int cover) Rolls the to-hit number- Specified by:
rollHitLocationin classEntity
-
rollHitLocation
Rolls up a hit location- Specified by:
rollHitLocationin classEntity
-
getTransferLocation
Gets the location that excess damage transfers to. That is, one location inwards.- Specified by:
getTransferLocationin classEntity
-
autoSetInternal
public void autoSetInternal()Sets the internal structure for every location to appropriate undamaged values for the unit and location.- Specified by:
autoSetInternalin classEntity
-
getWeaponArc
public int getWeaponArc(int weaponNumber) Returns the Rules.ARC that the weapon, specified by number, fires into.- Specified by:
getWeaponArcin classEntity- Parameters:
weaponNumber- integer equipment number, index from equipment list- Returns:
- arc the specified weapon is in
-
isSecondaryArcWeapon
public boolean isSecondaryArcWeapon(int weaponId) Returns true if this weapon fires into the secondary facing arc. If false, assume it fires into the primary.- Specified by:
isSecondaryArcWeaponin classEntity
-
getNoOfSlots
public int[] getNoOfSlots()- Specified by:
getNoOfSlotsin classEntity
-
addEquipment
public void addEquipment(Mounted<?> mounted, int loc, boolean rearMounted) throws LocationFullException Description copied from class:EntityAdds the given mounted equipment to the unit in the given location, possibly rear-facing depending on the given parameter. This method adds the mounted to the right equipment lists, updates the unit's tech level and adds one-shot ammo where necessary. Overriding methods may perform more tasks. This method, by default, does *NOT* create crit slots, update or add linkages nor handle secondary locations. Overrides for unit types may however do that.- Overrides:
addEquipmentin classEntity- Parameters:
mounted- The new equipmentloc- The location; may be Entity.LOC_NONErearMounted- True to make the equipment rear-facing- Throws:
LocationFullException- When the location is full
-
victoryReport
Calculates a "generic" Battle Value that is based on the average of all units of this type and tonnage. The purpose of this generic Battle Value is to allow a comparison of this unit's actual BV to that for units of its class. This can be used to balance forces without respect to unit or pilot quality./** Generates a vector containing reports on all useful information about this entity.
- Specified by:
victoryReportin classEntity
-
addEntityBonuses
Add in any piloting skill mods- Specified by:
addEntityBonusesin classEntity
-
isRepairable
public boolean isRepairable()Description copied from class:EntityDetermine if the unit can be repaired, or only harvested for spares.- Overrides:
isRepairablein classEntity- Returns:
- A
booleanthat istrueif the unit can be repaired (given enough time and parts); if this value isfalse, the unit is only a source of spares. - See Also:
-
isTargetable
public boolean isTargetable()Description copied from class:EntityReturns true if this entity is targetable for attacks. A unit is targetable if it is not destroyed, not doomed, deployed, not off board, not being transported, and not captured.- Overrides:
isTargetablein classEntity
-
canCharge
public boolean canCharge() -
canFlee
Description copied from class:EntityReturns true when this unit can flee from the given position in its current state. This requires the unit to have mobility and be in control as well as the position being eligible for fleeing. When no special flee area is set by a scenario, the latter will typically be true when the position is at the edge of its board. A null position as well as offboard units are considered to be eligible for fleeing. -
canGoDown
public boolean canGoDown() -
canGoDown
Description copied from class:Entityis it possible to go down, or are we landed/just above the water/treeline? assuming passed elevation. -
getCost
Calculates and returns the C-bill cost of the unit. The parameter ignoreAmmo can be used to include or exclude ("dry cost") the cost of ammunition on the unit. A report for the cost calculation will be written to the given calcReport. -
isNuclearHardened
public boolean isNuclearHardened()Description copied from class:EntityChecks if the unit is hardened against nuclear strikes.- Overrides:
isNuclearHardenedin classEntity- Returns:
- true if this is a hardened unit.
-
getTotalCommGearTons
public int getTotalCommGearTons()- Overrides:
getTotalCommGearTonsin classEntity- Returns:
- the total tonnage of communications gear in this entity
-
getEngineHits
public int getEngineHits()- Specified by:
getEngineHitsin classEntity
-
isSalvage
public boolean isSalvage()Buildings are salvageable unless they have completely collapsed. A building has completely collapsed when all hexes have 0 CF. -
isCrippled
public boolean isCrippled()Description copied from class:EntityReturns TRUE if the entity meets the requirements for crippling damage as detailed in TW pg 258.- Specified by:
isCrippledin classEntity- Returns:
- boolean
-
isCrippled
public boolean isCrippled(boolean checkCrew) Returns TRUE if the entity meets the requirements for crippling damage as detailed in TW pg 258. Excepting dead or non-existing crew issues- Specified by:
isCrippledin classEntity- Returns:
- boolean
-
isDmgHeavy
public boolean isDmgHeavy()Returns TRUE if the entity has been heavily damaged.- Specified by:
isDmgHeavyin classEntity- Returns:
- boolean
-
isDmgModerate
public boolean isDmgModerate()Returns TRUE if the entity has been moderately damaged.- Specified by:
isDmgModeratein classEntity- Returns:
- boolean
-
isDmgLight
public boolean isDmgLight()Returns TRUE if the entity has been lightly damaged.- Specified by:
isDmgLightin classEntity- Returns:
- boolean
-
getArmorType
public int getArmorType(int loc) - Overrides:
getArmorTypein classEntity
-
getArmorTechLevel
public int getArmorTechLevel(int loc) - Overrides:
getArmorTechLevelin classEntity
-
hasStealth
public boolean hasStealth()- Overrides:
hasStealthin classEntity- Returns:
- True if this unit has working stealth armor (not patchwork armor).
-
getEntityType
public long getEntityType()- Specified by:
getEntityTypein classEntity
-
getInternalForReal
public int getInternalForReal(int loc) - Overrides:
getInternalForRealin classEntity
-
getArmor
public int getArmor(int loc, boolean rear) Returns the amount of armor in the location specified, or IArmorState.ARMOR_NA, or IArmorState.ARMOR_DESTROYED. -
setInternal
public void setInternal(int val, int loc) Override to keep entity internal and building CF synchronized.- Overrides:
setInternalin classEntity
-
hasCFIn
Description copied from interface:IBuildingDetermines if the coord exist in the currentCF has. -
getCoords
Description copied from interface:IBuildingGet the coordinates that the building occupies. -
getCoordsList
Description copied from interface:IBuildingReturns a list of this Building's coords. The list is unmodifiable.- Specified by:
getCoordsListin interfaceIBuilding
-
getBuildingType
Description copied from interface:IBuildingGet the construction type of the building. This value will be one of the values defined in megamek.common.enums.BuildingType- Specified by:
getBuildingTypein interfaceIBuilding- Returns:
- the
intcode of the building's construction type.
-
getBldgClass
public int getBldgClass()Description copied from interface:IBuildingGet the building class, per TacOps rules.- Specified by:
getBldgClassin interfaceIBuilding- Returns:
- the
intcode of the building's classification.
-
getBasementCollapsed
Description copied from interface:IBuildingGet the building basement, per TacOps rules.- Specified by:
getBasementCollapsedin interfaceIBuilding- Returns:
- the
intcode of the building basement type.
-
collapseBasement
- Specified by:
collapseBasementin interfaceIBuilding
-
rollBasement
Description copied from interface:IBuildingRoll what kind of basement this building has- Specified by:
rollBasementin interfaceIBuilding- Parameters:
coords- theCoordsof the building to roll forvPhaseReport- theReportVectorcontaining the phase report- Returns:
- a
booleanindicating weather the hex and building was changed or not
-
getCurrentCF
Description copied from interface:IBuildingGet the current construction factor of the building hex at the passed coords. Any damage immediately updates this value.- Specified by:
getCurrentCFin interfaceIBuilding- Parameters:
coords- theCoordsof the hex in question- Returns:
- the
intvalue of the building hex's current construction factor. This value will be greater than or equal to zero.
-
getPhaseCF
Description copied from interface:IBuildingGet the construction factor of the building hex at the passed coords at the start of the current phase. Damage that is received during the phase is applied at the end of the phase.- Specified by:
getPhaseCFin interfaceIBuilding- Parameters:
coords- theCoordsof the hex in question- Returns:
- the
intvalue of the building's construction factor at the start of this phase. This value will be greater than or equal to zero.
-
getArmor
-
setCurrentCF
Description copied from interface:IBuildingSet the current construction factor of the building hex. Call this method immediately when the building sustains any damage.- Specified by:
setCurrentCFin interfaceIBuilding- Parameters:
cf- theintvalue of the building hex's current construction factor. This value must be greater than or equal to zero.coords- theCoordsof the hex in question
-
setPhaseCF
Description copied from interface:IBuildingSet the construction factor of the building hex for the start of the next phase. Call this method at the end of the phase to apply damage sustained by the building during the phase.- Specified by:
setPhaseCFin interfaceIBuilding- Parameters:
cf- theintvalue of the building hex's current construction factor. This value must be greater than or equal to zero.coords- theCoordsof the hex in question
-
setArmor
-
getHeight
Description copied from interface:IBuildingGet the height (BLDG_ELEV) of the building hex at the passed coords. -
setHeight
Description copied from interface:IBuildingSet the height of a specific building hex. Call this method when a hex is destroyed (set to 0). -
getName
Description copied from interface:IBuildingGet the name of this building. -
isBurning
Description copied from interface:IBuildingDetermine if this building is on fire. -
setBurning
Description copied from interface:IBuildingSet the flag that indicates that this building is on fire.- Specified by:
setBurningin interfaceIBuilding- Parameters:
onFire- - abooleanvalue that indicates whether this building is on fire.
-
addDemolitionCharge
Demolition charges anchor to an absolute board hex, which only works for structures that cannot move.BuildingEntityoverrides this with a real implementation;MobileStructuremust provide its own (or remain unsupported) if mobile structures are ever ruled to be valid demolition targets.- Specified by:
addDemolitionChargein interfaceIBuilding- Throws:
UnsupportedOperationException- always; subclasses that support demolition charges must override
-
removeDemolitionCharge
- Specified by:
removeDemolitionChargein interfaceIBuilding
-
getDemolitionCharges
- Specified by:
getDemolitionChargesin interfaceIBuilding
-
setDemolitionCharges
- Specified by:
setDemolitionChargesin interfaceIBuilding
-
removeHex
Description copied from interface:IBuildingRemove one building hex from the building -
getOriginalHexCount
public int getOriginalHexCount()- Specified by:
getOriginalHexCountin interfaceIBuilding
-
getCollapsedHexCount
public int getCollapsedHexCount()- Specified by:
getCollapsedHexCountin interfaceIBuilding
-
getBasement
- Specified by:
getBasementin interfaceIBuilding
-
setBasement
- Specified by:
setBasementin interfaceIBuilding
-
setBasementCollapsed
- Specified by:
setBasementCollapsedin interfaceIBuilding
-
updateBuildingEntityHexes
Once a building entity has set its position, we need to update the board itself and share that with the clients -
refreshLocations
public void refreshLocations()- Overrides:
refreshLocationsin classEntity
-
collapseFloorsOnHex
- Parameters:
coords- BoardCoordsthat contain this building and are collapsingnumLevelsToCollapse- number of floors to collapse, from the top
-
getNCrew
public int getNCrew()Calculate building crew based on Advanced Building Minimum Crew Table (TO:AUE). Crew = Non-Gunners + Gunners + Officers -
isBoardable
public boolean isBoardable()Description copied from class:EntityDetermines if this entity can be boarded by infantry for interior combat. Used for TO:AR p. 167 Infantry vs Infantry combat eligibility as a target for initiation. This will eventually include dropships, large naval vessels, and other boardable entities.- Overrides:
isBoardablein classEntity- Returns:
- true if infantry can board this entity to initiate interior combat
-
canReinforceInfantryVsInfantry
public boolean canReinforceInfantryVsInfantry()Description copied from class:EntityDetermines if this entity can reinforce ongoing infantry vs infantry combat. Default implementation returns false. Infantry units override this.- Overrides:
canReinforceInfantryVsInfantryin classEntity- Returns:
- true if this entity can reinforce infantry vs infantry combat
-