Class BaseGraphCalulationService
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.sea.BaseGraphCalulationService
-
- All Implemented Interfaces:
ch.sahits.game.graphic.image.model.MapGrid
- Direct Known Subclasses:
AStarGraphProvider,AStarHeuristicProvider
public abstract class BaseGraphCalulationService extends java.lang.Object implements ch.sahits.game.graphic.image.model.MapGridService providing methods for the calculation of the heuristic and the graph.- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Jan 01, 2016
-
-
Field Summary
Fields Modifier and Type Field Description protected ch.sahits.game.graphic.image.IMapImageServiceFacadeimageServiceprotected ch.sahits.game.openpatrician.model.map.IMapmapprotected com.google.common.collect.Interner<javafx.geometry.Point2D>pointInterner
-
Constructor Summary
Constructors Constructor Description BaseGraphCalulationService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract doublecalculateWeight(javafx.geometry.Point2D from, javafx.geometry.Point2D to)Calculate the weight between two nodes.protected javafx.geometry.Point2DgetPoint(double x, double y)protected java.util.List<ch.sahits.game.graphic.image.ECircleSegment>getSegments(javafx.geometry.Point2D from, javafx.geometry.Point2D to)protected java.util.List<ch.sahits.game.graphic.image.ECircleSegment>getTangentialSegments(javafx.geometry.Point2D from, javafx.geometry.Point2D to)booleanisOnSea(javafx.geometry.Point2D point)Verify that a location is actually on sea.
-
-
-
Method Detail
-
getPoint
protected javafx.geometry.Point2D getPoint(double x, double y)
-
calculateWeight
protected abstract double calculateWeight(javafx.geometry.Point2D from, javafx.geometry.Point2D to)Calculate the weight between two nodes.- Parameters:
from- source nodeto- destination node- Returns:
- weight of the edge from node
fromtoto
-
getSegments
protected java.util.List<ch.sahits.game.graphic.image.ECircleSegment> getSegments(javafx.geometry.Point2D from, javafx.geometry.Point2D to)
-
getTangentialSegments
protected java.util.List<ch.sahits.game.graphic.image.ECircleSegment> getTangentialSegments(javafx.geometry.Point2D from, javafx.geometry.Point2D to)
-
isOnSea
public boolean isOnSea(javafx.geometry.Point2D point)
Verify that a location is actually on sea.- Parameters:
point- to be checked- Returns:
- true if the point is at sea.
-
-