Package megamek.common
Class InfantryWeaponMounted
java.lang.Object
megamek.common.Mounted<WeaponType>
megamek.common.equipment.WeaponMounted
megamek.common.InfantryWeaponMounted
- All Implemented Interfaces:
Serializable
,PhaseUpdated
,RoundUpdated
Specialized mount used for infantry units with primary and secondary weapons.
This handles special features of both weapons. Infantry units that only have
a single weapon should use
Mounted
.- See Also:
-
Field Summary
Fields inherited from class megamek.common.Mounted
baseDamageAbsorptionRate, baseDamageCapacity, damageTaken, MINE_ACTIVE, MINE_COMMAND_DETONATED, MINE_CONVENTIONAL, MINE_EMP, MINE_INFERNO, MINE_NONE, MINE_VIBRABOMB, switchedReason
-
Constructor Summary
ConstructorsConstructorDescriptionInfantryWeaponMounted
(Entity entity, InfantryWeapon rangeWeapon, InfantryWeapon otherWeapon) Creates a Mounted that deals with combined feature of a primary and a secondary weapon. -
Method Summary
Modifier and TypeMethodDescriptionvoid
adaptToGameOptions
(IGameOptions options) boolean
canInstantSwitch
(int newMode) Can the switch from the current mode to the new mode happen instantly?protected EquipmentMode
getMode
(int mode) int
boolean
hasModes()
boolean
hasModeType
(String mode) void
Methods inherited from class megamek.common.equipment.WeaponMounted
addAmmoToBay, addAmmoToBay, addWeaponToBay, addWeaponToBay, ammoInBay, assignAPDS, bayComponentsToString, bayContains, bayContains, clearBayAmmo, clearBayWeapons, getBayAmmo, getBayWeapon, getBayWeapons, getCurrentHeat, getCurrentShots, getExplosionDamage, getHeatByBay, getLinkedAmmo, isAPDS, isGroundBomb, isOneShot, removeAmmoFromBay, removeFromBay, removeFromBay, removeWeaponFromBay, removeWeaponFromBay
Methods inherited from class megamek.common.Mounted
allLocations, byShot, canFire, canFire, countQuirks, createMounted, curMode, equipmentIndex, getArmorValue, getBaMountLoc, getBaseDesc, getBaseShotsLeft, getCalledShot, getCost, getCriticals, getCrossLinkedBy, getDesc, getEntity, getEquipmentNum, getFacing, getFoundCrits, getHittableShotsLeft, getLinked, getLinkedBayId, getLinkedBy, getLocation, getMissingTrooperString, getName, getNumShots, getNWeapons, getOriginalShots, getQuirkList, getQuirks, getSecondLocation, getShortName, getSize, getSwitchedReason, getTonnage, getTonnage, getType, getUsableShotsLeft, hasChargedCapacitor, hasChargedOrChargingCapacitor, hasQuirk, hasUsableShotsLeft, is, isAmmoUsable, isAnyMissingTroopers, isAPMMounted, isArmored, isBodyMounted, isBombMounted, isBreached, isCrippled, isDestroyed, isDumping, isDWPMounted, isFired, isHit, isHomingAmmoInHomingMode, isHotLoaded, isInBearingsOnlyMode, isInoperable, isInternalBomb, isInWaypointLaunchMode, isJammed, isMekTurretMounted, isMissing, isMissingForTrooper, isModeSwitchable, isOmniPodMounted, isOneShotAmmo, isOperable, isPendingDump, isPintleTurretMounted, isRapidfire, isReady, isReady, isRearMounted, isRepairable, isSplit, isSplitable, isSponsonTurretMounted, isSquadSupportWeapon, isTSEMPDowntime, isTurret, isUsedThisRound, isWeaponGroup, jammedThisPhase, newPhase, newRound, pendingMode, resetJam, restore, setAPMMounted, setArmored, setArmorValue, setBaMountLoc, setBombMounted, setBreached, setByShot, setCrossLinked, setCrossLinkedBy, setDestroyed, setDumping, setDWPMounted, setFacing, setFired, setFoundCrits, setHit, setHotLoad, setInternalBomb, setJammed, setLinked, setLinkedBayId, setLinkedBy, setLocation, setLocation, setMekTurretMounted, setMissing, setMissingForTrooper, setMode, setMode, setModesForMapType, setModeSwitchable, setNWeapons, setOmniPodMounted, setOriginalShots, setPendingDump, setPintleTurretMounted, setQuirks, setRapidfire, setRepairable, setSecondLocation, setSecondLocation, setShotsLeft, setSize, setSplit, setSponsonTurretMounted, setSquadSupportWeapon, setSwitchedReason, setTSEMPDowntime, setType, setUsedThisRound, setWeaponGroup, switchMode, toString, unlink, usedInPhase
-
Constructor Details
-
InfantryWeaponMounted
Creates a Mounted that deals with combined feature of a primary and a secondary weapon. Infantry units with a single type of weapon should useMounted
- Parameters:
entity
- The infantry unitrangeWeapon
- The weapon used to calculate range.otherWeapon
- The other weapon
-
-
Method Details
-
getOtherWeapon
-
rebuildModeList
public void rebuildModeList() -
getModesCount
public int getModesCount()- Overrides:
getModesCount
in classMounted<WeaponType>
-
getMode
- Overrides:
getMode
in classMounted<WeaponType>
-
hasModes
public boolean hasModes()- Overrides:
hasModes
in classMounted<WeaponType>
-
hasModeType
- Overrides:
hasModeType
in classMounted<WeaponType>
-
canInstantSwitch
public boolean canInstantSwitch(int newMode) Description copied from class:Mounted
Can the switch from the current mode to the new mode happen instantly?- Overrides:
canInstantSwitch
in classMounted<WeaponType>
- Parameters:
newMode
- - integer that represents the new mode- Returns:
- true if the new mode can be switched instantly
-
adaptToGameOptions
- Overrides:
adaptToGameOptions
in classMounted<WeaponType>
-