Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class Plant{
- public int age;
- public boolean isInfested;
- public boolean isBurning;
- public int plantPrice;
- public int maxAge;
- public Plant(Player player){
- this.age = 0;
- this.isInfested = false;
- this.isBurning = false;
- player.money -= this.plantPrice;
- }
- public void aging(){
- if (this.age < this.maxAge){
- ++this.age;
- }
- }
- public void setFire(){
- this.isBurning = true;
- }
- public void setInfested(){
- this.isInfested = true;
- }
- public boolean harvested(){
- return (!isBurning && !isInfested && this.age == this.maxAge);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement