Package megamek.common.equipment
Record Class INarcPod
java.lang.Object
java.lang.Record
megamek.common.equipment.INarcPod
- All Implemented Interfaces:
Serializable
,InGameObject
,BTObject
,Targetable
public record INarcPod(int team, int type, int location)
extends Record
implements Serializable, Targetable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
Fields 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_SEARCHLIGHT
-
Constructor Summary
ConstructorsConstructorDescriptionINarcPod
(int team, int type, int location) Creates a newINarcPod
, from the team and of the type specified. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determine if the other object is an equivalent INarc pod.Returns the general name or type name of this unit/object.int
int
Returns the elevation of this target, relative to the position Hex's surfaceint
Returns the height of the target, that is, how many levels above its elevation it is for LOS purposes.int
getId()
Returns this InGameObject's id.int
Returns the unique id of this InGameObject's owning player.int
Returns the current (remaining) battle strength of this unit or object.int
int
hashCode()
Returns a hash code value for this object.static INarcPod
idToInstance
(int id) Create a new iNarc pod that is equivalent to the given ID.boolean
boolean
boolean
Determines if this target should be considered the enemy of the supplied player.boolean
Returns true if the target is considered immobile (-4 to hit).boolean
int
location()
Returns the value of thelocation
record component.int
void
setId
(int newId) Sets this InGameObject's id.void
setOwnerId
(int newOwnerId) Sets the unique id of this InGameObject's owning player.int
int
Returns the specific name or type name of this unit/object.int
team()
Returns the value of theteam
record component.toString()
Get aString
representing this INarc pod.int
type()
Returns the value of thetype
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface megamek.common.units.BTObject
getFluffImage, getIcon, hasAerodyneSpheroidDistinction, isAero, isAerodyne, isAerospace, isAerospaceFighter, isAerospaceSV, isBattleArmor, isBattleMek, isCarryableObject, 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
Methods inherited from interface megamek.common.game.InGameObject
countForStrengthSum, hasOwner
Methods inherited from interface megamek.common.units.Targetable
getBoardId, getBoardLocation, isBomber, isBracing, isHexBeingBombed, isOnBoard, tracksHeat
-
Field Details
-
HOMING
public static final int HOMING- See Also:
-
ECM
public static final int ECM- See Also:
-
HAYWIRE
public static final int HAYWIRE- See Also:
-
NEMESIS
public static final int NEMESIS- See Also:
-
-
Constructor Details
-
INarcPod
public INarcPod(int team, int type, int location) Creates a newINarcPod
, from the team and of the type specified.
-
-
Method Details
-
equals
Determine if the other object is an equivalent INarc pod.Overrides
Object#equals(Object)
.- Specified by:
equals
in interfaceTargetable
- Specified by:
equals
in classRecord
- Parameters:
obj
- the otherObject
which may be an equivalent INarc pod.- Returns:
true
if the other object matches this one,false
otherwise.
-
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components.- Specified by:
hashCode
in interfaceTargetable
- Specified by:
hashCode
in classRecord
- Returns:
- a hash code value for this object
-
toString
Get aString
representing this INarc pod.Overrides
Object#toString()
. -
idToInstance
Create a new iNarc pod that is equivalent to the given ID.- Parameters:
id
- theint
ID of the iNarc pod.- Returns:
- a new
INarcPod
that matches the ID.
-
getTargetType
public int getTargetType()- Specified by:
getTargetType
in interfaceTargetable
-
getId
public int getId()Description copied from interface:InGameObject
Returns this InGameObject's id. The id must be unique to this InGameObject within the current game. equals() must return true for two InGameObject objects with the same id.- Specified by:
getId
in interfaceInGameObject
- Returns:
- The game-unique id of this InGameObject (Entity, AlphaStrikeElement etc.)
-
setId
public void setId(int newId) Description copied from interface:InGameObject
Sets this InGameObject's id. The id must be unique to this InGameObject within the current game. equals() must return true for two InGameObject objects with the same id.- Specified by:
setId
in interfaceInGameObject
- Parameters:
newId
- The game-unique id of this InGameObject (Entity, AlphaStrikeElement etc.)
-
getOwnerId
public int getOwnerId()Description copied from interface:InGameObject
Returns the unique id of this InGameObject's owning player. This id may be Player.NONE.- Specified by:
getOwnerId
in interfaceInGameObject
- Returns:
- The player id of the owner of this InGameObject.
-
setOwnerId
public void setOwnerId(int newOwnerId) Description copied from interface:InGameObject
Sets the unique id of this InGameObject's owning player. This id may be Player.NONE.- Specified by:
setOwnerId
in interfaceInGameObject
- Parameters:
newOwnerId
- The player id of the owner of this InGameObject.
-
getStrength
public int getStrength()Description copied from interface:InGameObject
Returns the current (remaining) battle strength of this unit or object. For combat units, this is the battle value (BV) or the point value (PV).- Specified by:
getStrength
in interfaceInGameObject
- Returns:
- The current battle strength (BV/PV)
-
getPosition
- Specified by:
getPosition
in interfaceTargetable
- Returns:
- the coordinates of the hex containing the target
-
getSecondaryPositions
- Specified by:
getSecondaryPositions
in interfaceTargetable
-
relHeight
public int relHeight()- Specified by:
relHeight
in interfaceTargetable
- Returns:
- elevation of the top (e.g. torso) of the target relative to surface
-
getHeight
public int getHeight()Description copied from interface:Targetable
Returns the height of the target, that is, how many levels above its elevation it is for LOS purposes.- Specified by:
getHeight
in interfaceTargetable
- Returns:
- height of the target in elevation levels
-
getElevation
public int getElevation()Description copied from interface:Targetable
Returns the elevation of this target, relative to the position Hex's surface- Specified by:
getElevation
in interfaceTargetable
- Returns:
- elevation of the bottom (e.g. legs) of the target relative to surface
-
isImmobile
public boolean isImmobile()Description copied from interface:Targetable
Returns true if the target is considered immobile (-4 to hit). If this is a game unit, implementations should check the status of the unit (shutdown, damage) and also the status of the crew (unconscious) if any.- Specified by:
isImmobile
in interfaceTargetable
- Returns:
- True if the target is considered immobile
-
getDisplayName
- Specified by:
getDisplayName
in interfaceTargetable
- Returns:
- name of the target for ui purposes
-
sideTable
- Specified by:
sideTable
in interfaceTargetable
- Returns:
- side hit from location
-
sideTable
- Specified by:
sideTable
in interfaceTargetable
- Returns:
- side hit from location
-
isOffBoard
public boolean isOffBoard()- Specified by:
isOffBoard
in interfaceTargetable
- Returns:
- if this is off the board
-
isAirborne
public boolean isAirborne()- Specified by:
isAirborne
in interfaceTargetable
- Returns:
- Is the entity airborne in the fashion of an aerospace unit? Does not include VTOL movement (see
Targetable.isAirborneVTOLorWIGE()
-
isAirborneVTOLorWIGE
public boolean isAirborneVTOLorWIGE()- Specified by:
isAirborneVTOLorWIGE
in interfaceTargetable
- Returns:
- is the entity airborne in the fashion of a VTOL Not used for aerospace units, see
Targetable.isAirborne()
-
getAltitude
public int getAltitude()- Specified by:
getAltitude
in interfaceTargetable
- Returns:
- altitude of target
-
isEnemyOf
Description copied from interface:Targetable
Determines if this target should be considered the enemy of the supplied player. Targets that aren't owned by any player, such as buildings or terrain, are always considered enemies, since this will most often be used to determine if something is valid to be shot at.- Specified by:
isEnemyOf
in interfaceTargetable
-
generalName
Description copied from interface:BTObject
Returns the general name or type name of this unit/object. For standard individual units, this is the chassis. For other types of units or objects this can be the full designation or a general part of the designation. Much like the chassis, this can be much more narrow than the general type of unit ("Mek").The general name should not be empty and not return null. Return the chassis in Entity and AlphaStrikeElement.
- Specified by:
generalName
in interfaceBTObject
- Returns:
- The general name / chassis
-
specificName
Description copied from interface:BTObject
Returns the specific name or type name of this unit/object. For standard individual units, this is the model. For other types of units or objects this can be a part of the designation, or empty.The specific name should not return null. Return the model in Entity and AlphaStrikeElement.
- Specified by:
specificName
in interfaceBTObject
- Returns:
- The specific name / model
-
team
public int team()Returns the value of theteam
record component.- Returns:
- the value of the
team
record component
-
type
public int type()Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
location
public int location()Returns the value of thelocation
record component.- Returns:
- the value of the
location
record component
-