AbstractBuilding implements Clickable, Drawable,
        Tickable { @Override public boolean containsPoint(Point point) { return point.getX() >= this.location.getX() && point.getX() <= this.location.getX() + this.getWidth() && point.getY() >= this.location.getY() && point.getY() <= this.location.getY() + this.getHeight(); } AbstractBuilding(World world, int width, int height,
            String imageName); World getWorld(); Point getLocation(); void setLocation(Point location); boolean isLocationValid(); boolean addToWorld(); void removeFromWorld(); List<Tile> getTiles(); int getWidth(); int getHeight(); Image getSprite(); int getSpriteOffset(); void setSprite(String imageName); long getCurrentHealth(); void setHealth(long health); long getMaxHealth(); void setMaxHealth(long maxHealth); long damageHealth(long damage); long healHealth(long heal); void fullyRestoreHealth(); boolean onChangeHealth(long newHealth); void setPollutionSource(double rate); void removePollutionSource(); double getPollutionRate(); boolean isBuilt(); void completeBuilding(); void setBuildTime(int buildTime); int getBuildTime(); @Override void draw(Viewport viewport, GraphicsContext ctx); @Override double getWorldX(); @Override double getWorldY(); void onPlace(); void onBuild(); void onRemove(); @Override boolean containsPoint(Point point); @Override void click(Point location); void onClick(Point location); void onDoubleClick(Point location); @Override void tick(); @Override String toString(); static final int DOUBLE_CLICK_TIME; static final int DEFAULT_MAX_HEALTH; static final int DEFAULT_BUILD_TIME; }
@Test public void testContainsPoint() { Point location = new Point(1, 3); building.setLocation(location); Point point1 = new Point(1, 3); Point point2 = new Point(4.75, 5.33); Point point3 = new Point(5.1, 3.25); Point point4 = new Point(1, 7); Point point5 = new Point(0.92, 3.5); Point point6 = new Point(4, 2.8); assertTrue("containsPoint [point1] was incorrect", building.containsPoint(point1)); assertTrue("containsPoint [point2] was incorrect", building.containsPoint(point2)); assertFalse("containsPoint [point3] was incorrect", building.containsPoint(point3)); assertFalse("containsPoint [point4] was incorrect", building.containsPoint(point4)); assertFalse("containsPoint [point6] was incorrect", building.containsPoint(point5)); assertFalse("containsPoint [point6] was incorrect", building.containsPoint(point6)); }