package avs.models;

import avs.utils.Textures;

import java.awt.image.*;
import java.awt.*;

import javax.swing.*;

public abstract class Plant extends Entity {
    protected BufferedImage[] animation;
	private boolean isAlive;
    protected int cost;
    private int hp;

    public Plant(int w, int h, int cost, Textures texx) {
        super(w,h,texx);
        this.cost = cost;
        this.isAlive = true;
    }

	public Plant(double x, double y, int w, int h, int cost, Textures texx){
		super(x, y, w, h, texx);
        this.cost = cost;
		this.isAlive = true;
	}

	public boolean isAlive(){
		return this.isAlive;
	}

	public void setIsAlive(boolean isAlive){
		this.isAlive = isAlive;
	}

    public int getCost() {
        return this.cost;
    }

    public int getHp(){
    	return this.hp;
    }

    public void setHp(int hp){
        this.hp = hp;
    }
}

@@ -40,16 +40,40 @@
 extures;
+%0Aimport avs.models.Grid;
 %0A%0Aimport
@@ -291,16 +291,38 @@
 nt hp;%0A%0A
+    private int row;%0A%0A
     publ
@@ -462,159 +462,70 @@
  %7D%0A%0A
-%09
+    
 public 
-Plant(double x, double y, int w, int h, int cost, Textures texx)%7B%0A%09%09super(x, y, w, h, texx);%0A        this.cost = cost;%0A%09%09this.isAlive = true;%0A%09
+void setRow(int row) %7B%0A        this.row = row;%0A    
 %7D%0A%0A%09
@@ -792,16 +792,16 @@
 nt hp)%7B%0A
-
         
@@ -819,11 +819,208 @@
 p;%0A    %7D
+%0A%0A    public Rectangle getBounds() %7B%0A        int y = Grid.SIDEWALK_OFFSET + this.row * Grid.TILE_HEIGHT;%0A        return new Rectangle((int) this.getX(), y, this.getWidth(), Grid.TILE_HEIGHT);%0A    %7D
 %0A%7D%0A

Fix bounds of plant.