public class Unit extends GameObject
Modifier and Type | Field and Description |
---|---|
boolean |
acted
Whether or not this Unit has performed its action this turn.
|
int |
blueium
The amount of blueium carried by this unit.
|
int |
blueiumOre
The amount of blueium ore carried by this unit.
|
int |
health
The remaining health of a unit.
|
Job |
job
The Job this Unit has.
|
int |
moves
The number of moves this unit has left this turn.
|
Player |
owner
The Player that owns and can control this Unit.
|
int |
redium
The amount of redium carried by this unit.
|
int |
rediumOre
The amount of redium ore carried by this unit.
|
int |
stunImmune
Duration of stun immunity.
|
int |
stunTime
Duration the unit is stunned.
|
Tile |
tile
The Tile this Unit is on.
|
logs
Modifier and Type | Method and Description |
---|---|
boolean |
act(Tile tile)
Makes the unit do something to a machine or unit adjacent to its tile.
|
boolean |
attack(Tile tile)
Attacks a unit on an adjacent tile.
|
boolean |
drop(Tile tile,
int amount,
java.lang.String material)
Drops materials at the units feet or adjacent tile.
|
boolean |
move(Tile tile)
Moves this Unit from its current Tile to an adjacent Tile.
|
boolean |
pickup(Tile tile,
int amount,
java.lang.String material)
Picks up material at the units feet or adjacent tile.
|
log
public boolean acted
public int blueium
public int blueiumOre
public int health
public Job job
public int moves
public Player owner
public int redium
public int rediumOre
public int stunImmune
public int stunTime
public Tile tile
public boolean act(Tile tile)
tile
- The tile the unit acts on.public boolean attack(Tile tile)
tile
- The Tile to attack.public boolean drop(Tile tile, int amount, java.lang.String material)
tile
- The tile the materials will be dropped on.amount
- The number of materials to dropped. Amounts <= 0 will drop all the materials.material
- The material the unit will drop. 'redium', 'blueium', 'redium ore', or 'blueium ore'.public boolean move(Tile tile)
tile
- The Tile this Unit should move to.public boolean pickup(Tile tile, int amount, java.lang.String material)
tile
- The tile the materials will be picked up from.amount
- The amount of materials to pick up. Amounts <= 0 will pick up all the materials that the unit can.material
- The material the unit will pick up. 'redium', 'blueium', 'redium ore', or 'blueium ore'.© 2020 MST ACM SIG-GAME