public class Beaver extends GameObject
Modifier and Type | Field and Description |
---|---|
int |
actions
The number of actions remaining for the Beaver this turn.
|
int |
branches
The amount of branches this Beaver is holding.
|
int |
food
The amount of food this Beaver is holding.
|
int |
health
How much health this Beaver has left.
|
Job |
job
The Job this Beaver was recruited to do.
|
int |
moves
How many moves this Beaver has left this turn.
|
Player |
owner
The Player that owns and can control this Beaver.
|
boolean |
recruited
True if the Beaver has finished being recruited and can do things, False otherwise.
|
Tile |
tile
The Tile this Beaver is on.
|
int |
turnsDistracted
Number of turns this Beaver is distracted for (0 means not distracted).
|
logs
Modifier and Type | Method and Description |
---|---|
boolean |
attack(Beaver beaver)
Attacks another adjacent beaver.
|
boolean |
buildLodge()
Builds a lodge on the Beavers current Tile.
|
boolean |
drop(Tile tile,
java.lang.String resource)
Defaults the value for the optional arg 'amount' to '0'
|
boolean |
drop(Tile tile,
java.lang.String resource,
int amount)
Drops some of the given resource on the beaver's Tile.
|
boolean |
harvest(Spawner spawner)
Harvests the branches or food from a Spawner on an adjacent Tile.
|
boolean |
move(Tile tile)
Moves this Beaver from its current Tile to an adjacent Tile.
|
boolean |
pickup(Tile tile,
java.lang.String resource)
Defaults the value for the optional arg 'amount' to '0'
|
boolean |
pickup(Tile tile,
java.lang.String resource,
int amount)
Picks up some branches or food on the beaver's tile.
|
log
public int actions
public int branches
public int food
public int health
public Job job
public int moves
public Player owner
public boolean recruited
public Tile tile
public int turnsDistracted
public boolean attack(Beaver beaver)
beaver
- The Beaver to attack. Must be on an adjacent Tile.public boolean buildLodge()
public boolean drop(Tile tile, java.lang.String resource)
drop(Tile, String, int)
public boolean drop(Tile tile, java.lang.String resource, int amount)
tile
- The Tile to drop branches/food on. Must be the same Tile that the Beaver is on, or an adjacent one.resource
- The type of resource to drop ('branches' or 'food').amount
- The amount of the resource to drop, numbers <= 0 will drop all the resource type.public boolean harvest(Spawner spawner)
spawner
- The Spawner you want to harvest. Must be on an adjacent Tile.public boolean move(Tile tile)
tile
- The Tile this Beaver should move to.public boolean pickup(Tile tile, java.lang.String resource)
pickup(Tile, String, int)
public boolean pickup(Tile tile, java.lang.String resource, int amount)
tile
- The Tile to pickup branches/food from. Must be the same Tile that the Beaver is on, or an adjacent one.resource
- The type of resource to pickup ('branches' or 'food').amount
- The amount of the resource to drop, numbers <= 0 will pickup all of the resource type.© 2020 MST ACM SIG-GAME