Class SeafaringService
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.sea.SeafaringService
-
@Component @Lazy @DependentInitialisation(ch.sahits.game.openpatrician.model.initialisation.StartNewGameBean.class) public class SeafaringService extends java.lang.ObjectService keeping track of all the ships that are traveling.- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Jan 04, 2016
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.common.eventbus.AsyncEventBusclientServerEventBus
-
Constructor Summary
Constructors Constructor Description SeafaringService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtravelBetweenCities(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity toCity)Travel from one city to another.voidtravelFromCity(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, javafx.geometry.Point2D location)Travel from a city to a place that is not a city.voidtravelNotBetweenCities(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, javafx.geometry.Point2D location)Travel between two locations, where neither is a city.java.util.List<javafx.geometry.Point2D>travelTo(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, javafx.geometry.Point2D destination)Send a ship or convoy on its way to a destination.voidtravelToCity(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity toCity)Travel from a location that is not a city to a city.
-
-
-
Method Detail
-
travelTo
public java.util.List<javafx.geometry.Point2D> travelTo(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, javafx.geometry.Point2D destination)Send a ship or convoy on its way to a destination.- Parameters:
vessel- that is sentdestination- of the travel- Returns:
- list of points defining the path.
-
travelBetweenCities
public void travelBetweenCities(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity toCity)Travel from one city to another.- Parameters:
vessel- which travels between citiestoCity- destination city
-
travelToCity
public void travelToCity(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.city.ICity toCity)Travel from a location that is not a city to a city.- Parameters:
vessel- traveling to a citytoCity- destination city
-
travelNotBetweenCities
public void travelNotBetweenCities(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, javafx.geometry.Point2D location)Travel between two locations, where neither is a city.- Parameters:
vessel- travelling between two locations at sealocation- destination location
-
travelFromCity
public void travelFromCity(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, javafx.geometry.Point2D location)Travel from a city to a place that is not a city.- Parameters:
vessel- traveling from a city to a location at sealocation- destination location
-
-