public abstract class UnitImpl extends java.lang.Object implements Unit
Modifier and Type | Class and Description |
---|---|
class |
UnitImpl.TrainingSlot |
Modifier | Constructor and Description |
---|---|
protected |
UnitImpl() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
cancelResearch() |
protected boolean |
cancelTrain() |
protected boolean |
cancelTrain(int slot) |
protected boolean |
cancelUpgrade() |
protected boolean |
canResearch(TechType techType) |
protected boolean |
canTrain(UnitType type) |
protected boolean |
canUpgrade(UpgradeType upgradeType) |
int |
compareTo(Unit otherUnit) |
boolean |
equals(java.lang.Object obj) |
boolean |
exists() |
protected java.util.Collection<UnitImpl> |
getAllUnits() |
double |
getAngle() |
int |
getBottom() |
<T extends Unit> |
getClosest(java.util.Collection<T> group) |
protected int |
getCurrentFrame() |
protected DamageEvaluator |
getDamageEvaluator() |
double |
getDistance(int x,
int y) |
double |
getDistance(Position target) |
int |
getDistance(Unit target) |
int |
getId() |
int |
getInitiallySpotted()
Returns the frame number this unit was visible the first time.
|
Position |
getInitialPosition() |
TilePosition |
getInitialTilePosition() |
int |
getKillCount() |
int |
getLastSpotted()
Returns the frame number this unit was visible last.
|
int |
getLeft() |
Position |
getMiddle(Unit unit) |
protected Order |
getOrder() |
protected Unit |
getOrderTarget() |
protected Position |
getOrderTargetPosition() |
protected Player |
getPlayer() |
protected Player |
getPlayer(int id) |
Position |
getPosition() |
protected Position |
getRallyPosition() |
protected Unit |
getRallyUnit() |
protected ResearchingFacility.ResearchInProgress |
getResearchInProgress() |
int |
getRight() |
protected Order |
getSecondaryOrder() |
UnitSizeType |
getSize() |
TilePosition |
getTilePosition() |
int |
getTop() |
UnitType |
getType()
Returns the type of this unit.
|
protected Unit |
getUnit(int id) |
<T extends Unit> |
getUnitsInRadius(int radius,
java.util.Collection<T> group) |
protected ResearchingFacility.UpgradeInProgress |
getUpgradeInProgress() |
int |
getX() |
int |
getY() |
int |
hashCode() |
int |
height() |
boolean |
isFlying() |
boolean |
isSelected() |
protected boolean |
issueCommand(int unitId,
UnitCommandType unitCommandType,
int targetUnitId,
int x,
int y,
int extra) |
boolean |
isVisible() |
protected boolean |
research(TechType techType) |
protected boolean |
setRallyPoint(Position p) |
protected boolean |
setRallyPoint(Unit target) |
int |
tileHeight() |
int |
tileWidth() |
java.lang.String |
toString() |
protected boolean |
train(UnitType type) |
protected boolean |
upgrade(UpgradeType upgrade) |
int |
width() |
public int getKillCount()
getKillCount
in interface Unit
public int getLastSpotted()
Unit
getLastSpotted
in interface Unit
public int getInitiallySpotted()
Unit
getInitiallySpotted
in interface Unit
protected java.util.Collection<UnitImpl> getAllUnits()
protected Unit getUnit(int id)
protected DamageEvaluator getDamageEvaluator()
protected Player getPlayer()
protected Player getPlayer(int id)
public <T extends Unit> T getClosest(java.util.Collection<T> group)
getClosest
in interface Unit
public <T extends Unit> java.util.List<T> getUnitsInRadius(int radius, java.util.Collection<T> group)
getUnitsInRadius
in interface Unit
public int tileHeight()
tileHeight
in interface Unit
public TilePosition getTilePosition()
getTilePosition
in interface Unit
public Position getPosition()
getPosition
in interface Unit
public UnitSizeType getSize()
public double getDistance(Position target)
getDistance
in interface Unit
public double getDistance(int x, int y)
getDistance
in interface Unit
public int getDistance(Unit target)
getDistance
in interface Unit
public UnitType getType()
Unit
UnitType.Resource_Vespene_Geyser
to UnitType.Zerg_Extractor
a new instance
will be created, and this instance will no longer be updated.public Position getInitialPosition()
getInitialPosition
in interface Unit
public TilePosition getInitialTilePosition()
getInitialTilePosition
in interface Unit
protected Order getOrder()
protected Unit getOrderTarget()
protected Position getOrderTargetPosition()
protected Order getSecondaryOrder()
protected int getCurrentFrame()
protected boolean cancelResearch()
protected boolean cancelUpgrade()
protected boolean canResearch(TechType techType)
protected boolean canUpgrade(UpgradeType upgradeType)
protected boolean research(TechType techType)
protected boolean upgrade(UpgradeType upgrade)
protected ResearchingFacility.UpgradeInProgress getUpgradeInProgress()
protected ResearchingFacility.ResearchInProgress getResearchInProgress()
protected boolean canTrain(UnitType type)
protected boolean train(UnitType type)
protected boolean cancelTrain(int slot)
protected boolean cancelTrain()
protected boolean setRallyPoint(Position p)
protected boolean setRallyPoint(Unit target)
protected Position getRallyPosition()
protected Unit getRallyUnit()
public boolean isSelected()
isSelected
in interface Unit
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(Unit otherUnit)
compareTo
in interface java.lang.Comparable<Unit>
protected boolean issueCommand(int unitId, UnitCommandType unitCommandType, int targetUnitId, int x, int y, int extra)