@Component @Lazy public class LocationTracker extends Object implements ch.sahits.game.openpatrician.model.sea.ILocationTracker
| Modifier and Type | Field and Description |
|---|---|
private ch.sahits.game.openpatrician.model.AIPlayerList |
aiPlayers |
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private org.apache.logging.log4j.Logger |
logger |
private ch.sahits.game.openpatrician.model.map.IMap |
map |
private javafx.geometry.Dimension2D |
mapDimension |
private ch.sahits.game.openpatrician.model.PlayerList |
players |
protected com.google.common.collect.Interner<javafx.geometry.Point2D> |
pointInterner |
private double |
segmentEdgeHeigth |
private double |
segmentEdgeWidth |
private List<WeakReference<ch.sahits.game.openpatrician.model.ship.INavigableVessel>>[][] |
segments |
private com.google.common.eventbus.EventBus |
syncServerClientEventBus |
| Constructor and Description |
|---|
LocationTracker() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(ch.sahits.game.openpatrician.model.ship.INavigableVessel ship) |
(package private) int[] |
calculateIndices(javafx.geometry.Point2D location) |
(package private) int[] |
calculateRowsAndColumnsNeeded(int numberOfImages,
javafx.geometry.Dimension2D containerSize)
Calculate the number of segments the image is partitioned into
|
private javafx.geometry.Point2D |
getPointOnMap(double x,
double y)
Ensure that the point is on the map.
|
List<ch.sahits.game.openpatrician.model.ship.INavigableVessel> |
getShipsInSegment(javafx.geometry.Point2D location) |
List<ch.sahits.game.openpatrician.model.ship.INavigableVessel> |
getShipsInSegments(javafx.geometry.Point2D location,
int radius) |
void |
handleGameLoad(GameStateChange gameStateChange) |
void |
handleShipMove(ShipPositionUpdateEvent event) |
(package private) void |
initialize() |
void |
remove(ch.sahits.game.openpatrician.model.ship.INavigableVessel ship) |
private void |
unregister() |
void |
updateSegmentSize(int nbShips) |
private final org.apache.logging.log4j.Logger logger
@Autowired private ch.sahits.game.openpatrician.model.map.IMap map
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
@Autowired @Qualifier(value="syncServerClientEventBus") private com.google.common.eventbus.EventBus syncServerClientEventBus
@Autowired protected com.google.common.collect.Interner<javafx.geometry.Point2D> pointInterner
@Autowired private ch.sahits.game.openpatrician.model.AIPlayerList aiPlayers
@Autowired private ch.sahits.game.openpatrician.model.PlayerList players
private javafx.geometry.Dimension2D mapDimension
private double segmentEdgeWidth
private double segmentEdgeHeigth
private List<WeakReference<ch.sahits.game.openpatrician.model.ship.INavigableVessel>>[][] segments
@PostConstruct void initialize()
@PreDestroy private void unregister()
public void updateSegmentSize(int nbShips)
int[] calculateIndices(javafx.geometry.Point2D location)
public void add(ch.sahits.game.openpatrician.model.ship.INavigableVessel ship)
add in interface ch.sahits.game.openpatrician.model.sea.ILocationTrackerpublic void remove(ch.sahits.game.openpatrician.model.ship.INavigableVessel ship)
public List<ch.sahits.game.openpatrician.model.ship.INavigableVessel> getShipsInSegment(javafx.geometry.Point2D location)
public List<ch.sahits.game.openpatrician.model.ship.INavigableVessel> getShipsInSegments(javafx.geometry.Point2D location, int radius)
private javafx.geometry.Point2D getPointOnMap(double x,
double y)
x - y - public void handleShipMove(ShipPositionUpdateEvent event)
int[] calculateRowsAndColumnsNeeded(int numberOfImages,
javafx.geometry.Dimension2D containerSize)
numberOfImages - target number of segmentscontainerSize - dimension of the imagepublic void handleGameLoad(GameStateChange gameStateChange)
Copyright © 2011-2016 Sahits GmbH. All Rights Reserved.