/** * This method checks if the point is contained by the map and by the shape. */ @Override public boolean contains(ShortPoint2D position) { return inMap(position) && base.contains(position); }
/** * Occupies the given area for the given playerId if it is not already occupied by towers of an enemy. * * @param playerId * The id of the occupying player. * @param influencingArea * The area affected by the tower. * @param groundArea * The ground area of the tower. */ public void addTowerAndOccupyArea(byte playerId, MapCircle influencingArea, FreeMapArea groundArea) { IMapArea filteredArea = new MapShapeFilter(influencingArea, width, height); PartitionOccupyingTower tower = new PartitionOccupyingTower(playerId, influencingArea.getCenter(), groundArea, filteredArea, influencingArea.getBorders(), (int) influencingArea.getRadius()); occupyAreaOfTower(tower); }