| Modifier and Type | Field and Description |
|---|---|
private int |
baseSalaryPerDay |
private Map<IShipDueDate,Optional<TimedTask>> |
buildList |
private int |
buildTimeCog |
private int |
buildTimeCrayer |
private int |
buildTimeHolk |
private int |
buildTimeSnaikka |
private ICity |
city |
private Date |
date |
private double |
experience
Value between 0 and 1 detailing the experience of the ship yard crew (the higher the better)
|
private org.apache.logging.log4j.Logger |
logger |
private IMap |
map |
private int |
materialUnitCost |
private DependentPropertyInitializer |
propertyInitializer |
private Map<IShipDueDate,Optional<TimedTask>> |
refitList |
private Map<IShipDueDate,Optional<TimedTask>> |
repairList |
private int |
repairTimeCog |
private int |
repairTimeCrayer |
private int |
repairTimeHolk |
private int |
repairTimeSnaikka |
private Random |
rnd |
private TimedUpdatableTaskList |
taskList |
| Constructor and Description |
|---|
ShipyardState(ICity city) |
| Modifier and Type | Method and Description |
|---|---|
void |
addShipBuildingOrder(IShipDueDate dueDate,
Optional<TimedTask> task)
Add an order for building a new ship to the list.
|
void |
addShipRefitOrder(IShipDueDate dueDate,
Optional<TimedTask> task)
Add an order for refitting a ship to the list.
|
void |
addShipRepairOrder(IShipDueDate dueDate,
Optional<TimedTask> task)
Add an order for repairing a ship to the list.
|
int |
calculateBuildTime(EShipType type)
Calculate the build time for the ship of type.
|
int |
calculateConstructionCosts(EShipType type)
Calculate the labor costs for building a new ship of the indicated type.
|
int |
calculateRefitCosts(EShipType type,
int levels)
Calculate the labor costs for the refit based on the ship type and how many levels
should be upgraded.
|
int |
calculateRefitTime(EShipType type)
Calculate the time in days it takes for refitting.
|
int |
calculateRepairCosts(int repairTime,
int materialCosts)
Calculate the repair costs.
|
int |
calculateRepairMaterialCosts(IShip ship,
int damage)
Calculate the material costs for the repair.
|
int |
calculateRepairTime(EShipType type)
Calculate the repair time for the ship of type.
|
private int |
calculateSaleryPerDay()
Salery is defined by the experiance
|
void |
cancelRepair(IShip ship)
Cancel the repair of the ship.
|
void |
cancelShipBuildingOrder(org.joda.time.DateTime finish)
Cancel the order of the building, finished on the given date.
|
void |
cleanup()
Remove entries that lie in the past.
|
EShipType[] |
getBuildableShipTypes()
Retrieve a list of all the types of ships this yard can build.
|
org.joda.time.DateTime |
getBuildCompleteDate(EShipType type)
Retrieve the date when the building of a new ship will be finished.
|
List<IShipDueDate> |
getShipBuildingList()
Retrieve an immutable list of the ships that are ordered
to be built on this shipyard.
|
List<IShipDueDate> |
getShipRepairList()
Retrieve the list of all ships that are to be repaired.
|
private double |
getShipSize(IShip ship) |
List<IShipDueDate> |
getShipUpgradeList()
Retrieve the list of all ships that are to be upgraded.
|
void |
initializeExperience() |
private final org.apache.logging.log4j.Logger logger
@DependentValue(value="shipyard.build.time.snaikka") private int buildTimeSnaikka
@DependentValue(value="shipyard.build.time.crayer") private int buildTimeCrayer
@DependentValue(value="shipyard.build.time.cog") private int buildTimeCog
@DependentValue(value="shipyard.build.time.holk") private int buildTimeHolk
@DependentValue(value="shipyard.repair.time.snaikka") private int repairTimeSnaikka
@DependentValue(value="shipyard.repair.time.crayer") private int repairTimeCrayer
@DependentValue(value="shipyard.repair.time.cog") private int repairTimeCog
@DependentValue(value="shipyard.repair.time.holk") private int repairTimeHolk
@Value(value="${shipyard.material.cost.per.unit}")
private int materialUnitCost
@Value(value="${shipyard.salary.per.day}")
private int baseSalaryPerDay
private final Map<IShipDueDate,Optional<TimedTask>> repairList
private final Map<IShipDueDate,Optional<TimedTask>> buildList
private final Map<IShipDueDate,Optional<TimedTask>> refitList
private double experience
@Autowired private Date date
@Autowired private Random rnd
private final ICity city
@Autowired private TimedUpdatableTaskList taskList
@Autowired private IMap map
@Autowired private DependentPropertyInitializer propertyInitializer
public ShipyardState(ICity city)
@PostConstruct public void initializeExperience()
public List<IShipDueDate> getShipBuildingList()
IShipyardgetShipBuildingList in interface IShipyardpublic List<IShipDueDate> getShipUpgradeList()
IShipyardgetShipUpgradeList in interface IShipyardpublic void addShipBuildingOrder(IShipDueDate dueDate, Optional<TimedTask> task)
IShipyardaddShipBuildingOrder in interface IShipyarddueDate - when the ship is finished buildingtask - that is executed on completion.public void cancelShipBuildingOrder(org.joda.time.DateTime finish)
IShipyardcancelShipBuildingOrder in interface IShipyardfinish - datepublic List<IShipDueDate> getShipRepairList()
IShipyardgetShipRepairList in interface IShipyardpublic void addShipRepairOrder(IShipDueDate dueDate, Optional<TimedTask> task)
IShipyardaddShipRepairOrder in interface IShipyarddueDate - when the ship is finished repairingtask - that is executed on completion.public int calculateRepairMaterialCosts(IShip ship, int damage)
IShipyardcalculateRepairMaterialCosts in interface IShipyardprivate double getShipSize(IShip ship)
public int calculateRepairCosts(int repairTime,
int materialCosts)
IShipyardcalculateRepairCosts in interface IShipyardprivate int calculateSaleryPerDay()
public void cancelRepair(IShip ship)
IShipyardcancelRepair in interface IShipyardship - which's repair order is to be canceledpublic void addShipRefitOrder(IShipDueDate dueDate, Optional<TimedTask> task)
IShipyardaddShipRefitOrder in interface IShipyarddueDate - when the ship is refittedtask - that is executed on completion.public int calculateRefitTime(EShipType type)
IShipyardcalculateRefitTime in interface IShipyardtype - destination levelpublic org.joda.time.DateTime getBuildCompleteDate(EShipType type)
IShipyardgetBuildCompleteDate in interface IShipyardtype - of the ship to be builtpublic int calculateBuildTime(EShipType type)
calculateBuildTime in interface IShipyardtype - public int calculateRepairTime(EShipType type)
calculateRepairTime in interface IShipyardtype - public void cleanup()
public int calculateRefitCosts(EShipType type, int levels)
IShipyardcalculateRefitCosts in interface IShipyardpublic int calculateConstructionCosts(EShipType type)
IShipyardcalculateConstructionCosts in interface IShipyardtype - of the shippublic EShipType[] getBuildableShipTypes()
IShipyardgetBuildableShipTypes in interface IShipyardCopyright © 2011-2016 Sahits GmbH. All Rights Reserved.