@DependentInitialisation(ch.sahits.game.openpatrician.model.initialisation.StartNewGameBean.class)
public class SeaFightService
extends java.lang.Object
calculateOutcome(INavigableVessel, INavigableVessel, SeaFightContext). There are helper methods explodeShipList
to convert the IShips to the required List of ships. There are further helper methods to collect the ships
lists again after the fight.| Constructor | Description |
|---|---|
SeaFightService() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
calculateOutcome(ch.sahits.game.openpatrician.model.ship.INavigableVessel attackingVessel,
ch.sahits.game.openpatrician.model.ship.INavigableVessel defendingVessel,
SeaFightContext context) |
Calculate the outcome of the fight.
|
java.util.List<ch.sahits.game.openpatrician.model.ship.IShip> |
explodeShipList(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel) |
Convert a vessel into a list of ships.
|
ch.sahits.game.openpatrician.model.ship.IConvoy |
regroup(java.util.List<ch.sahits.game.openpatrician.model.ship.IShip> ships,
ch.sahits.game.openpatrician.model.ship.IConvoy oldConvoy) |
Update the convoy with the ships of the list.
|
ch.sahits.game.openpatrician.model.ship.IShipGroup |
regroup(java.util.List<ch.sahits.game.openpatrician.model.ship.IShip> ships,
ch.sahits.game.openpatrician.model.ship.IShipGroup oldGroup) |
Create a group of ships from the list of ships.
|
public void calculateOutcome(ch.sahits.game.openpatrician.model.ship.INavigableVessel attackingVessel,
ch.sahits.game.openpatrician.model.ship.INavigableVessel defendingVessel,
SeaFightContext context)
attackingVessel - attacking vessel.defendingVessel - defending vessel.public java.util.List<ch.sahits.game.openpatrician.model.ship.IShip> explodeShipList(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
vessel - input vessel of type IConvoy, IShipGroup or simple IShippublic ch.sahits.game.openpatrician.model.ship.IShipGroup regroup(java.util.List<ch.sahits.game.openpatrician.model.ship.IShip> ships,
ch.sahits.game.openpatrician.model.ship.IShipGroup oldGroup)
ships - List of shipsoldGroup - previous group of ships to be updated, may be null.oldGroup or a new instance containing the ships of the listpublic ch.sahits.game.openpatrician.model.ship.IConvoy regroup(java.util.List<ch.sahits.game.openpatrician.model.ship.IShip> ships,
ch.sahits.game.openpatrician.model.ship.IConvoy oldConvoy)
ships - List of shipsoldConvoy - previous convoy that is to be updated.oldConvoy.Copyright © 2011-2018 Sahits GmbH. All Rights Reserved.