public class Unit extends GameObject
Modifier and Type | Field and Description |
---|---|
boolean |
acted
Whether or not this Unit has performed its action this turn.
|
double |
dashX
The x value this unit is dashing to.
|
double |
dashY
The y value this unit is dashing to.
|
int |
energy
The remaining health of the unit.
|
int |
genarium
The amount of Genarium ore carried by this unit.
|
boolean |
isBusy
Tracks whether or not the ship is dashing or Mining.
|
Job |
job
The Job this Unit has.
|
int |
legendarium
The amount of Legendarium ore carried by this unit.
|
double |
moves
The distance this unit can still move.
|
int |
mythicite
The amount of Mythicite carried by this unit.
|
Player |
owner
The Player that owns and can control this Unit.
|
Unit |
protector
The martyr ship that is currently shielding this ship if any.
|
int |
rarium
The amount of Rarium carried by this unit.
|
int |
shield
The shield that a martyr ship has.
|
double |
x
The x value this unit is on.
|
double |
y
The y value this unit is on.
|
logs
Modifier and Type | Method and Description |
---|---|
boolean |
attack(Unit enemy)
Attacks the specified unit.
|
boolean |
dash(double x,
double y)
Causes the unit to dash towards the designated destination.
|
boolean |
mine(Body body)
Allows a miner to mine a asteroid.
|
boolean |
move(double x,
double y)
Moves this Unit from its current location to the new location specified.
|
boolean |
safe(double x,
double y)
Tells you if your ship can move to that location from were it is without clipping the sun.
|
boolean |
shootdown(Projectile missile)
Attacks the specified projectile.
|
boolean |
transfer(Unit unit,
int amount,
java.lang.String material)
Grab materials from a friendly unit.
|
log
public boolean acted
public double dashX
public double dashY
public int energy
public int genarium
public boolean isBusy
public Job job
public int legendarium
public double moves
public int mythicite
public Player owner
public Unit protector
public int rarium
public int shield
public double x
public double y
public boolean attack(Unit enemy)
enemy
- The Unit being attacked.public boolean dash(double x, double y)
x
- The x value of the destination's coordinates.y
- The y value of the destination's coordinates.public boolean mine(Body body)
body
- The object to be mined.public boolean move(double x, double y)
x
- The x value of the destination's coordinates.y
- The y value of the destination's coordinates.public boolean safe(double x, double y)
x
- The x position of the location you wish to arrive.y
- The y position of the location you wish to arrive.public boolean shootdown(Projectile missile)
missile
- The projectile being shot down.public boolean transfer(Unit unit, int amount, java.lang.String material)
unit
- The unit you are grabbing the resources from.amount
- The amount of materials to you with to grab. Amounts <= 0 will pick up all the materials that the unit can.material
- The material the unit will pick up. 'genarium', 'rarium', 'legendarium', or 'mythicite'.© 2020 MST ACM SIG-GAME