Import java. Until .Array List; public class Grid implements Grid Object { private Array List locations; private in t size; public Grid(in t size) { locations = new Array List(size*size); this. size=size; for(in t i=0; iCat = new Cat("feli x"); grid. Add Avatar (cat, 0, 2); grid. start(); } void start(){ } public interface Grid Object { } public class Location { public final in t x; public final in t y; private Grid Object grid Object; private Boolean occupied; public Location ( in t x ,in t y){ this .x=x; this .y=y; } public void set Grid Object(Grid Object grid Object){ this. grid Object=grid Object; occupied=true; } public bole an get Occupied(){ return occupied; } @Override public bole an equals(Object object){ if(object==null){ return false; } if(object instance of Location){ Location = (Location) object; if(location .x == x && location. y == y){ return true; } } return false; } }
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here