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 Unitpublic int getLastSpotted()
UnitgetLastSpotted in interface Unitpublic int getInitiallySpotted()
UnitgetInitiallySpotted in interface Unitprotected 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 Unitpublic <T extends Unit> java.util.List<T> getUnitsInRadius(int radius, java.util.Collection<T> group)
getUnitsInRadius in interface Unitpublic int tileHeight()
tileHeight in interface Unitpublic TilePosition getTilePosition()
getTilePosition in interface Unitpublic Position getPosition()
getPosition in interface Unitpublic UnitSizeType getSize()
public double getDistance(Position target)
getDistance in interface Unitpublic double getDistance(int x,
int y)
getDistance in interface Unitpublic int getDistance(Unit target)
getDistance in interface Unitpublic UnitType getType()
UnitUnitType.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 Unitpublic TilePosition getInitialTilePosition()
getInitialTilePosition in interface Unitprotected 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 Unitpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic 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)