Beispiel #1
0
 public boolean addFarmObjectToGrid(FarmObject obj) {
   if (grid[obj.getX()][obj.getY()] != null) {
     return false;
   }
   grid[obj.getX()][obj.getY()] = obj;
   return true;
 }
Beispiel #2
0
 private void move(FarmObject obj) {
   grid[obj.getX()][obj.getY()] = null;
   grid[obj.getNewX()][obj.getNewY()] = obj;
 }