| Modifier and Type | Field and Description |
|---|---|
private static com.google.common.base.Optional<TimedTask> |
ABSENT_TIMED_TASK |
private static int |
BASE_DAY_SALERY |
private static int |
BUILD_TIME_COG |
private static int |
BUILD_TIME_CRAYER |
private static int |
BUILD_TIME_HOLK |
private static int |
BUILD_TIME_SNAIKKA |
private Map<IShipDueDate,com.google.common.base.Optional<TimedTask>> |
buildList |
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 IMap |
map |
private static int |
MATERIAL_UNIT_COST |
private Map<IShipDueDate,com.google.common.base.Optional<TimedTask>> |
refitList |
private static int |
REPAIR_TIME_COG |
private static int |
REPAIR_TIME_CRAYER |
private static int |
REPAIR_TIME_HOLK |
private static int |
REPAIR_TIME_SNAIKKA |
private Map<IShipDueDate,com.google.common.base.Optional<TimedTask>> |
repairList |
private Random |
rnd |
private ShipFactory |
shipUtility |
private TimedUpdatableTaskList |
taskList |
| Constructor and Description |
|---|
ShipyardState(ICity city) |
| Modifier and Type | Method and Description |
|---|---|
void |
addShipBuildingOrder(IShipDueDate dueDate)
Update the state with a building order.
|
void |
addShipBuildingOrder(IShipDueDate dueDate,
com.google.common.base.Optional<TimedTask> task)
Add an order for building a new ship to the list.
|
void |
addShipRefitOrder(IShipDueDate dueDate,
com.google.common.base.Optional<TimedTask> task)
Add an order for refitting a ship to the list.
|
void |
addShipRepairOrder(IShipDueDate dueDate,
com.google.common.base.Optional<TimedTask> task)
Add an order for repairing a ship to the list.
|
void |
addShipToRepairList(IShipDueDate dueDate)
Add a ship to the repair list.
|
void |
addToRefitList(IShipDueDate dueDate) |
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) |
void |
initializeExperience() |
private static final int BUILD_TIME_SNAIKKA
private static final int BUILD_TIME_CRAYER
private static final int BUILD_TIME_COG
private static final int BUILD_TIME_HOLK
private static final int REPAIR_TIME_SNAIKKA
private static final int REPAIR_TIME_CRAYER
private static final int REPAIR_TIME_COG
private static final int REPAIR_TIME_HOLK
private static final int MATERIAL_UNIT_COST
private static final int BASE_DAY_SALERY
private static final com.google.common.base.Optional<TimedTask> ABSENT_TIMED_TASK
private final Map<IShipDueDate,com.google.common.base.Optional<TimedTask>> repairList
private final Map<IShipDueDate,com.google.common.base.Optional<TimedTask>> buildList
private final Map<IShipDueDate,com.google.common.base.Optional<TimedTask>> refitList
private double experience
@Autowired private Date date
@Autowired private Random rnd
private final ICity city
@Autowired private TimedUpdatableTaskList taskList
@Autowired private ShipFactory shipUtility
@Autowired private IMap map
public ShipyardState(ICity city)
@PostConstruct public void initializeExperience()
public List<IShipDueDate> getShipBuildingList()
IShipyardgetShipBuildingList in interface IShipyardpublic void addShipBuildingOrder(IShipDueDate dueDate, com.google.common.base.Optional<TimedTask> task)
IShipyardaddShipBuildingOrder in interface IShipyarddueDate - when the ship is finished buildingtask - that is executed on completion.public void addShipBuildingOrder(IShipDueDate dueDate)
IShipyardaddShipBuildingOrder in interface IShipyarddueDate - ship due datepublic void cancelShipBuildingOrder(org.joda.time.DateTime finish)
IShipyardcancelShipBuildingOrder in interface IShipyardfinish - datepublic List<IShipDueDate> getShipRepairList()
IShipyardgetShipRepairList in interface IShipyardpublic void addShipRepairOrder(IShipDueDate dueDate, com.google.common.base.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 IShipyardpublic void addShipToRepairList(IShipDueDate dueDate)
IShipyardaddShipToRepairList in interface IShipyarddueDate - ship due dateprivate int calculateSaleryPerDay()
public void cancelRepair(IShip ship)
IShipyardcancelRepair in interface IShipyardship - which's repair order is to be canceledpublic void addShipRefitOrder(IShipDueDate dueDate, com.google.common.base.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 void addToRefitList(IShipDueDate dueDate)
addToRefitList in interface IShipyardpublic 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-2015 Sahits GmbH. All Rights Reserved.