Package ch.sahits.game.graphic.image
Interface IMapImageServiceFacade
-
- All Superinterfaces:
IMapLocationProviderFacade
- All Known Implementing Classes:
MapImageServiceFacade
public interface IMapImageServiceFacade extends IMapLocationProviderFacade
- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Apr 25, 2016
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
countLandPixels(javafx.geometry.Point2D point, int radius, java.util.List<ECircleSegment> segments)
Count the number of black pixels in a circle aroundpoint
withradius
.double
distanceToShore(javafx.geometry.Point2D point, double max)
Check the if there is shore within a certain radius ofmax
.int
getHeight()
Retrieve the height of the map in pixels.javafx.geometry.Point2D
getLocationAtOtherEndOfMap(javafx.geometry.Point2D location)
Retrieve a random ponint that is at sea.int
getWidth()
£Retrieve the width of the map in pixels.boolean
isOnSea(int x, int y)
Check if a location on the image is white meaning it is at sea.-
Methods inherited from interface ch.sahits.game.openpatrician.model.server.IMapLocationProviderFacade
getRandomPointAtSea, getRandomPointAtSeaNear
-
-
-
-
Method Detail
-
isOnSea
boolean isOnSea(int x, int y)
Check if a location on the image is white meaning it is at sea.- Parameters:
x
- location to be checkedy
- location to be checked- Returns:
- true if the coordinates represent a coordinate at sea.
-
distanceToShore
double distanceToShore(javafx.geometry.Point2D point, double max) throws java.io.IOException
Check the if there is shore within a certain radius ofmax
. If there is the approximate distance is returned.- Parameters:
point
- that is to be checked.max
- maximum radius- Returns:
- maximum radius or approximate distance to the shore, whatever is smaller. If the approximate distance is returned it may be smaller than the actual distance to the nearest land.
- Throws:
java.io.IOException
-
countLandPixels
int countLandPixels(javafx.geometry.Point2D point, int radius, java.util.List<ECircleSegment> segments) throws java.io.IOException
Count the number of black pixels in a circle aroundpoint
withradius
.- Parameters:
point
- center point around which should be checkedradius
- radius of the area that should be checked.- Returns:
- number of pixels that represent land.
- Throws:
java.io.IOException
-
getLocationAtOtherEndOfMap
javafx.geometry.Point2D getLocationAtOtherEndOfMap(javafx.geometry.Point2D location)
Retrieve a random ponint that is at sea.- Parameters:
location
- near where the random point has to be located.- Returns:
- point located on the sea.
-
getWidth
int getWidth()
£Retrieve the width of the map in pixels.- Returns:
- width of the map
-
getHeight
int getHeight()
Retrieve the height of the map in pixels.- Returns:
- height of the map
-
-