예제 #1
0
 /**
  * Place the grass at the new location in the given field.
  *
  * @param newLocation The grass' new location.
  */
 public void setLocation(Location newLocation) {
   if (location != null) {
     field.clear(location);
   }
   location = newLocation;
   field.place(this, newLocation);
 }
예제 #2
0
 /** Kills the grass */
 public void setDead() {
   alive = false;
   if (location != null) {
     field.clear(location);
     location = null;
     field = null;
   }
 }