Example #1
0
  // Method that allows Predator to kill its Prey
  public void eat(Object p) {

    if (p.getClass().equals(Prey.class)) {
      Prey prey = (Prey) p;
      if (prey.isDiseased()) this.setDisease(true);
      lastMeal = 0;
      // System.out.println(this + " ate " + p);
      grid.remove(p);
    }
  }