/** * 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); }
/** Kills the grass */ public void setDead() { alive = false; if (location != null) { field.clear(location); location = null; field = null; } }