
// Animal.java
// Andrew Davison, Nov 2018, ad@fivedots.coe.psu.ac.th

/* Animal is an abstract superclass for animals.
 * It provides features common to all animals (foxes and rabbits),
 * such as their location and age.
 * 
 * @author David J. Barnes and Michael Kolling
 * @version 2006.03.30
 */


import java.util.List;


public abstract class Animal
{
  private int age;
  private boolean isAlive;
  private Location location;


  public Animal()
  { age = 0; // just born
    isAlive = true;
  }
    

  abstract public void act(Field currentField, Field updatedField, 
                                               List<Animal> newAnimals);
  /* Make this act() abstract, so the details must be filled in
     by the Rabbit/Fox subclasees. */


  public boolean isAlive()
  {  return isAlive;  }

  public void setDead()
  // tell the animal that it's dead now :(
  {  isAlive = false; }
    

  public int getAge()
  {  return age;  }

  public void setAge(int a)
  {  age = a; }
    

  public Location getLocation()
  {  return location;  }

  public void setLocation(int row, int col)
  {  location = new Location(row, col); }

  public void setLocation(Location loc)
  { location = loc;  }

}  // end of Animal *abstract* class
