-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMinerFull.java
More file actions
38 lines (34 loc) · 925 Bytes
/
MinerFull.java
File metadata and controls
38 lines (34 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import processing.core.PImage;
import java.util.List;
public class MinerFull
extends Miner
{
public MinerFull(String name, Point position, int rate,
int animation_rate, int resource_limit, List<PImage> imgs)
{
super(name, position, rate, animation_rate, resource_limit,
resource_limit, Blacksmith.class, imgs);
}
protected Miner transform(WorldModel world)
{
return new MinerNotFull(getName(), getPosition(), getRate(),
getAnimationRate(), getResourceLimit(), getImages());
}
protected boolean move(WorldModel world, WorldEntity smith)
{
if (smith == null)
{
return false;
}
if (adjacent(getPosition(), smith.getPosition()))
{
setResourceCount(0);
return true;
}
else
{
world.moveEntity(this, nextPosition(world, smith.getPosition()));
return false;
}
}
}