|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.BuildingTarget
public class BuildingTarget
This class represents a single, targetable hex of a building. The building itself may occupy multiple hexex.
| Field Summary |
|---|
| Fields inherited from interface megamek.common.Targetable |
|---|
TYPE_BLDG_IGNITE, 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_INARC_POD, TYPE_MINEFIELD_CLEAR, TYPE_MINEFIELD_DELIVER, TYPE_SEARCHLIGHT |
| Constructor Summary | |
|---|---|
BuildingTarget(Coords coords,
IBoard board,
boolean ignite)
Target a single hex of a building. |
|
BuildingTarget(Coords coords,
IBoard board,
int nType)
Target a single hex of a building. |
|
| Method Summary | |
|---|---|
int |
absHeight()
|
static int |
coordsToId(Coords c)
The transformation encodes the y value in the top 5 decimal digits and the x value in the bottom 5. |
int |
getAltitude()
|
java.lang.String |
getDisplayName()
|
int |
getElevation()
|
int |
getHeight()
|
Coords |
getPosition()
|
int |
getTargetId()
|
int |
getTargetType()
|
static Coords |
idToCoords(int id)
|
protected void |
init(Coords coords,
IBoard board,
boolean ignite)
Initialize this object from the input. |
boolean |
isAirborne()
|
boolean |
isAirborneVTOL()
|
boolean |
isImmobile()
|
boolean |
isOffBoard()
|
int |
sideTable(Coords src)
|
int |
sideTable(Coords src,
boolean usePrior)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BuildingTarget(Coords coords,
IBoard board,
int nType)
coords - - the Coords of the hext being targeted.board - - the game's Board object.type - - an int value that indicates whether the
player is attempting to set the building on fire, or not.
an - IllegalArgumentException will be thrown if
the given coordinates do not contain a building.
public BuildingTarget(Coords coords,
IBoard board,
boolean ignite)
coords - - the Coords of the hext being targeted.board - - the game's Board object.ignite - - a boolean flag that indicates whether the
player is attempting to set the building on fire, or not.
an - IllegalArgumentException will be thrown if
the given coordinates do not contain a building.| Method Detail |
|---|
protected void init(Coords coords,
IBoard board,
boolean ignite)
coords - - the Coords of the hext being targeted.board - - the game's Board object.ignite - - a boolean flag that indicates whether the
player is attempting to set the building on fire, or not.
an - IllegalArgumentException will be thrown if
the given coordinates do not contain a building.public int getTargetType()
getTargetType in interface Targetablepublic int getTargetId()
getTargetId in interface Targetablepublic Coords getPosition()
getPosition in interface Targetablepublic int absHeight()
absHeight in interface Targetablepublic int getHeight()
getHeight in interface Targetablepublic int getElevation()
getElevation in interface Targetablepublic boolean isImmobile()
isImmobile in interface Targetablepublic java.lang.String getDisplayName()
getDisplayName in interface Targetablepublic static int coordsToId(Coords c)
public static Coords idToCoords(int id)
public int sideTable(Coords src)
sideTable in interface Targetable
public int sideTable(Coords src,
boolean usePrior)
sideTable in interface Targetablepublic boolean isOffBoard()
isOffBoard in interface Targetablepublic boolean isAirborne()
isAirborne in interface TargetableTargetable.isAirborneVTOL()public boolean isAirborneVTOL()
isAirborneVTOL in interface TargetableTargetable.isAirborne()public int getAltitude()
getAltitude in interface Targetable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||