@Test public void within() throws Exception { TestWorld world1 = new TestWorld("test1"); Location loc1 = new Location(world1, 0.0, 4.0, 0.0); Location loc2 = new Location(world1, 10.0, 10.0, 10.0); Location loc3 = new Location(world1, 5.0, 5.0, 5.0); Bounds bounds = new Bounds(loc1, loc2); Location toCheck = loc3; assertTrue("Failed bounds check with null worlds", bounds.within(toCheck)); toCheck.setY(11.0); assertFalse("Y should be out of bounds", bounds.within(toCheck)); toCheck.setY(1.0); assertFalse("Y should be out of bounds", bounds.within(toCheck)); toCheck.setY(10.0); assertTrue("Y should be within bounds", bounds.within(toCheck)); toCheck.setY(6.0); assertTrue("Y should be within bounds", bounds.within(toCheck)); toCheck.setY( 4.0 ); assertTrue("Y should be within bounds", bounds.within(toCheck)); toCheck.setY( 3.0 ); assertTrue("Y should be within bounds", bounds.within(toCheck)); toCheck.setY( 2.0 ); assertFalse("Y should be out of bounds", bounds.within(toCheck)); }
public boolean within(Location location) { return within( location, false ); }
Bounds { public boolean within(Location location) { return within( location, false ); } }
Bounds { public boolean within(Location location) { return within( location, false ); } Bounds(Location min, Location max); }
Bounds { public boolean within(Location location) { return within( location, false ); } Bounds(Location min, Location max); void setWorld( World world ); double getWidth(); double getHeight(); double getLength(); double getArea(); boolean within(Location location); boolean withinIncludeTopOfMine(Location location); boolean withinSameWorld(Location location); boolean within(Location location, long radius); double getDistance(); double getDistance(Location location); double getDistance3d(Location location); String getDimensions(); Location getMin(); Location getMax(); Location getCenter(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); int getxBlockMin(); int getxBlockMax(); int getyBlockMin(); int getyBlockMax(); int getzBlockMin(); int getzBlockMax(); double getxMin(); double getxMax(); double getyMin(); double getyMax(); double getzMin(); double getzMax(); int getTotalBlockCount(); }
Bounds { public boolean within(Location location) { return within( location, false ); } Bounds(Location min, Location max); void setWorld( World world ); double getWidth(); double getHeight(); double getLength(); double getArea(); boolean within(Location location); boolean withinIncludeTopOfMine(Location location); boolean withinSameWorld(Location location); boolean within(Location location, long radius); double getDistance(); double getDistance(Location location); double getDistance3d(Location location); String getDimensions(); Location getMin(); Location getMax(); Location getCenter(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); int getxBlockMin(); int getxBlockMax(); int getyBlockMin(); int getyBlockMax(); int getzBlockMin(); int getzBlockMax(); double getxMin(); double getxMax(); double getyMin(); double getyMax(); double getzMin(); double getzMax(); int getTotalBlockCount();  }