|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.MoveStep
public class MoveStep
A single step in the entity's movment.
| Field Summary | |
|---|---|
(package private) java.util.TreeMap<java.lang.Integer,java.util.Vector<java.lang.Integer>> |
launched
|
| Constructor Summary | |
|---|---|
MoveStep(MovePath path,
MovePath.MoveStepType type)
Create a step of the given type. |
|
MoveStep(MovePath path,
MovePath.MoveStepType type,
boolean noCost)
|
|
MoveStep(MovePath path,
MovePath.MoveStepType type,
boolean noCost,
boolean isManeuver)
|
|
MoveStep(MovePath path,
MovePath.MoveStepType type,
int mineToLay)
Create a step with the given mine to lay. |
|
MoveStep(MovePath path,
MovePath.MoveStepType type,
int recovery,
int mineToLay)
|
|
MoveStep(MovePath path,
MovePath.MoveStepType type,
int recovery,
int mineToLay,
int manType)
|
|
MoveStep(MovePath path,
MovePath.MoveStepType type,
Minefield mf)
|
|
MoveStep(MovePath path,
MovePath.MoveStepType type,
Targetable target)
Create a step with the given target. |
|
MoveStep(MovePath path,
MovePath.MoveStepType type,
java.util.TreeMap<java.lang.Integer,java.util.Vector<java.lang.Integer>> targets)
Create a step with the units to launch or drop. |
|
| Method Summary | |
|---|---|
void |
addDistance(int increment)
Adds a certain amount to the distance parameter. |
void |
addMpUsed(int increment)
Adds a certain amount to the mpUsed parameter. |
void |
adjustFacing(MovePath.MoveStepType stepType)
Adjusts facing to comply with the type of step indicated. |
protected void |
calcMovementCostFor(IGame game,
Coords prev,
int prevEl)
Amount of movement points required to move from start to dest |
boolean |
canAeroTurn(IGame game)
can this aero turn for any reason in atmosphere? |
boolean |
canReuseSprite(MoveStep other)
|
boolean |
climbMode()
|
protected void |
compile(IGame game,
Entity entity,
MoveStep prev)
Compile the static move data for this step. |
void |
copy(IGame game,
MoveStep prev)
Takes the given state as the previous state and sets flags from it. |
boolean |
dueFreeTurn()
|
int |
getAltitude()
|
int |
getDistance()
|
int |
getElevation()
|
int |
getFacing()
|
int |
getHeat()
|
java.util.TreeMap<java.lang.Integer,java.util.Vector<java.lang.Integer>> |
getLaunched()
|
int |
getLeapDistance()
|
int |
getManeuverType()
|
Minefield |
getMinefield()
|
int |
getMineToLay()
|
EntityMovementType |
getMovementType()
Return this step's movement type. |
int |
getMp()
Returns the mp used for just this step. |
int |
getMpUsed()
|
int |
getNDown()
|
int |
getNMoved()
|
int |
getNRolls()
|
int |
getNStraight()
|
int |
getNTurns()
|
MovePath |
getParent()
|
MovePath |
getParentUpToThisStep()
get a copy of this MoveStep's parent, but only upto this step |
Coords |
getPosition()
|
int |
getRecoveryUnit()
|
Targetable |
getTarget(IGame game)
Get the target of the current step. |
int |
getTargetNumberMASC()
|
int |
getTotalHeat()
|
MovePath.MoveStepType |
getType()
|
int[] |
getVectors()
|
int |
getVelocity()
|
int |
getVelocityLeft()
|
int |
getVelocityN()
|
boolean |
hasFreeTurn()
|
boolean |
hasNoCost()
|
boolean |
isDanger()
|
boolean |
isEvading()
|
boolean |
isFirstStep()
|
boolean |
isFlying()
Returns true if the entity is flying on this step. |
boolean |
isHasJustStood()
|
boolean |
isHullDown()
|
boolean |
isLegal()
Determine if this is a legal step. |
boolean |
isLegalEndPos()
Check to see if this step's position is a valid end of a path. |
boolean |
isManeuver()
|
boolean |
isMovementPossible(IGame game,
Coords src,
int srcEl)
Is movement possible from a previous position to this one? |
boolean |
isOffBoard()
|
boolean |
isOnlyPavement()
|
boolean |
isPastDanger()
|
boolean |
isPavementStep()
|
boolean |
isPrevStepOnPavement()
|
boolean |
isProne()
|
boolean |
isRolled()
|
(package private) boolean |
isRunProhibited()
|
(package private) boolean |
isStackingViolation()
|
boolean |
isThisStepBackwards()
|
boolean |
isTurning()
|
boolean |
isUnloaded()
|
boolean |
isUsingMASC()
|
void |
moveInDir(int dir)
Moves the position one hex in the direction indicated. |
(package private) boolean |
oppositeTurn(MoveStep turn2)
Returns whether the two step types contain opposite turns |
void |
reverseFacing()
For yaws, reverse the current facing |
void |
setAltitude(int alt)
|
void |
setClimbMode(boolean b)
|
void |
setDanger(boolean b)
|
void |
setDistance(int i)
|
void |
setElevation(int el)
|
boolean |
setEndPos(boolean isEnd)
Update this step's status as the ending position of a path. |
void |
setEvading(boolean b)
|
void |
setFacing(int i)
|
void |
setFirstStep(boolean b)
|
void |
setFlying(boolean b)
Sets whether the entity is flying or not. |
void |
setFreeTurn(boolean b)
|
void |
setFromEntity(Entity entity,
IGame game)
Sets this state as coming from the entity. |
void |
setHasJustStood(boolean b)
|
void |
setHullDown(boolean b)
|
void |
setLeapDistance(int i)
|
void |
setMineToLay(int mineId)
|
void |
setMovementType(EntityMovementType i)
|
void |
setMp(int i)
sets the mp for this step. |
void |
setNDown(int i)
|
void |
setNMoved(int moved)
|
void |
setNRolls(int rolls)
|
void |
setNStraight(int i)
|
void |
setNTurns(int turns)
|
void |
setOffBoard(boolean b)
|
void |
setOnlyPavement(boolean b)
|
(package private) void |
setParent(MovePath path)
|
void |
setPavementStep(boolean b)
|
void |
setProne(boolean b)
|
void |
setRecoveryUnit(int i)
|
(package private) void |
setRunProhibited(boolean isRunProhibited)
|
(package private) void |
setStackingViolation(boolean isStackingViolation)
|
void |
setTarget(Targetable target)
Set the target of the current step. |
void |
setTargetNumberMASC(int i)
|
void |
setThisStepBackwards(boolean b)
|
void |
setTurning(boolean b)
|
void |
setUnloaded(boolean b)
|
void |
setUsingMASC(boolean b)
|
void |
setVectors(int[] v)
|
void |
setVelocity(int vel)
|
void |
setVelocityLeft(int vel)
|
void |
setVelocityN(int vel)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
java.util.TreeMap<java.lang.Integer,java.util.Vector<java.lang.Integer>> launched
| Constructor Detail |
|---|
public MoveStep(MovePath path,
MovePath.MoveStepType type)
type - - should match one of the MovePath constants, but this is not
currently checked.
public MoveStep(MovePath path,
MovePath.MoveStepType type,
Targetable target)
type - - should match one of the MovePath constants, but this is not
currently checked.target - - the Targetable that is the target of this
step. For example, the enemy being charged.
public MoveStep(MovePath path,
MovePath.MoveStepType type,
int mineToLay)
path - type - - should match one of the MovePath constants, but this is not
currently checked.mineToLay - - the int that is the id of the mine that
should be laid in this step.
public MoveStep(MovePath path,
MovePath.MoveStepType type,
java.util.TreeMap<java.lang.Integer,java.util.Vector<java.lang.Integer>> targets)
path - type - - should match one of the MovePath constants, but this is not
currently checked.targets - - vector of integers identifying the entities to launch
public MoveStep(MovePath path,
MovePath.MoveStepType type,
int recovery,
int mineToLay)
public MoveStep(MovePath path,
MovePath.MoveStepType type,
boolean noCost)
public MoveStep(MovePath path,
MovePath.MoveStepType type,
boolean noCost,
boolean isManeuver)
public MoveStep(MovePath path,
MovePath.MoveStepType type,
int recovery,
int mineToLay,
int manType)
public MoveStep(MovePath path,
MovePath.MoveStepType type,
Minefield mf)
| Method Detail |
|---|
void setParent(MovePath path)
public java.lang.String toString()
toString in class java.lang.Objectpublic MovePath.MoveStepType getType()
public MovePath getParent()
public MovePath getParentUpToThisStep()
public void setTarget(Targetable target)
target - - the Targetable that is the target of this
step. For example, the enemy being charged. If there is no
target, pass a nullpublic Targetable getTarget(IGame game)
game - - The Game object.
Targetable that is the target of this step.
For example, the enemy being charged. This value may be
nullpublic java.util.TreeMap<java.lang.Integer,java.util.Vector<java.lang.Integer>> getLaunched()
protected void compile(IGame game,
Entity entity,
MoveStep prev)
game - the Game being played.entity - the Entity taking this step.prev - the previous step in the path.boolean oppositeTurn(MoveStep turn2)
public void setElevation(int el)
public void setAltitude(int alt)
public void copy(IGame game,
MoveStep prev)
game - prev -
public void setFromEntity(Entity entity,
IGame game)
entity - public void adjustFacing(MovePath.MoveStepType stepType)
stepType - public void reverseFacing()
public void moveInDir(int dir)
dir - public void addDistance(int increment)
increment - public void addMpUsed(int increment)
increment - public boolean isDanger()
public int getDistance()
public int getLeapDistance()
public int getFacing()
public boolean isFirstStep()
public boolean isHasJustStood()
public boolean isPavementStep()
public boolean isProne()
public boolean isFlying()
public boolean isHullDown()
public boolean climbMode()
public boolean isTurning()
public boolean isUnloaded()
public boolean isUsingMASC()
public boolean isEvading()
public boolean isRolled()
public boolean isLegal()
true if the step is legal. false
otherwise.public EntityMovementType getMovementType()
int constant for this step's movement type.public boolean isLegalEndPos()
true if this step's position is a legal end of a
path. If the step is not legal for an end of a path, then
false is returned.public boolean setEndPos(boolean isEnd)
isEnd - the boolean flag that specifies that this
step's position is the end of a path.
true if the path needs to keep updating the steps.
false if the update of the path is complete.#isLegalEndPos(),
#isEndPos,
MovePath#addStep( MoveStep )public int getMpUsed()
public boolean isOnlyPavement()
public boolean isPastDanger()
public Coords getPosition()
public boolean isPrevStepOnPavement()
public int getTargetNumberMASC()
public boolean isThisStepBackwards()
public void setDanger(boolean b)
b - public void setDistance(int i)
i - public void setLeapDistance(int i)
i - public void setFacing(int i)
i - public void setFirstStep(boolean b)
b - public void setHasJustStood(boolean b)
b - public void setPavementStep(boolean b)
b - public void setProne(boolean b)
b - public void setFlying(boolean b)
b - is this entity flying?public void setHullDown(boolean b)
public void setClimbMode(boolean b)
public void setTurning(boolean b)
b - public void setUnloaded(boolean b)
b - public void setUsingMASC(boolean b)
b - public void setMovementType(EntityMovementType i)
i - public void setEvading(boolean b)
public void setOnlyPavement(boolean b)
b - public void setTargetNumberMASC(int i)
public void setThisStepBackwards(boolean b)
public int getMp()
public void setMp(int i)
i - the mp for this step.void setRunProhibited(boolean isRunProhibited)
boolean isRunProhibited()
void setStackingViolation(boolean isStackingViolation)
boolean isStackingViolation()
public int getTotalHeat()
public int getHeat()
protected void calcMovementCostFor(IGame game,
Coords prev,
int prevEl)
public boolean isMovementPossible(IGame game,
Coords src,
int srcEl)
public boolean canReuseSprite(MoveStep other)
public int getElevation()
public int getAltitude()
public int getMineToLay()
public void setMineToLay(int mineId)
public void setVelocity(int vel)
public int getVelocity()
public void setVelocityN(int vel)
public int getVelocityN()
public void setVelocityLeft(int vel)
public int getVelocityLeft()
public void setNTurns(int turns)
public int getNTurns()
public void setNMoved(int moved)
public int getNMoved()
public void setNRolls(int rolls)
public int getNRolls()
public void setOffBoard(boolean b)
public boolean isOffBoard()
public int[] getVectors()
public void setVectors(int[] v)
public boolean hasFreeTurn()
public void setFreeTurn(boolean b)
public int getNStraight()
public void setNStraight(int i)
public boolean canAeroTurn(IGame game)
public boolean dueFreeTurn()
public void setNDown(int i)
public int getNDown()
public int getRecoveryUnit()
public void setRecoveryUnit(int i)
public int getManeuverType()
public boolean hasNoCost()
public boolean isManeuver()
public Minefield getMinefield()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||