-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlant.java
More file actions
32 lines (25 loc) · 972 Bytes
/
Plant.java
File metadata and controls
32 lines (25 loc) · 972 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
import processing.core.PImage;
import java.util.List;
public abstract class Plant extends ActivityEntity implements Transform {
private int health;
private int healthLimit;
public Plant(String id, Point position, List<PImage> images, double actionPeriod, double animationPeriod, int health, int healthLimit) {
super(id, position, actionPeriod, animationPeriod, images);
this.health = health;
this.healthLimit = healthLimit;
}
public void executeActivity(WorldModel world, ImageStore imageStore, EventScheduler scheduler) {
if (!this.transform(world, scheduler, imageStore)) {
scheduler.scheduleEvent(this, Factory.createActivityAction(this, world, imageStore), getActionPeriod());
}
}
public int getHealth() {
return health;
}
public int getHealthLimit() {
return healthLimit;
}
public void setHealth(int health) {
this.health = health;
}
}