public class ShipFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
private static int |
COG_MAX_CAPACITY |
private static int |
COG_START_CAPACITY |
private org.springframework.context.ApplicationContext |
context |
private static int |
CRAYER_MAX_CAPACITY |
private static int |
CRAYER_START_CAPACITY |
private Date |
date |
private static int |
HOLK_MAX_CAPACITY |
private static int |
HOLK_START_CAPACITY |
private org.apache.log4j.Logger |
logger |
private IMap |
map |
private static int |
SNAIKKA_MAX_CAPACITY |
private static int |
SNAIKKA_START_CAPACITY |
| Constructor and Description |
|---|
ShipFactory() |
| Modifier and Type | Method and Description |
|---|---|
int |
calculateInitialCapacity(EShipType type,
double x)
Calulate the ships type's capacity based on the current year and the
eastwards degrading.
|
ICog |
createCog(String name,
EShipUpgrade upgradeLevel,
int value)
Create a cog with the given name.
|
ICog |
createCog(String name,
int value)
Create a a cog with the given name.
|
ICrayer |
createCrayer(String name,
EShipUpgrade upgradeLevel,
int value)
Create a crayer with the given name.
|
ICrayer |
createCrayer(String name,
int value)
Create a a crayer with the given name.
|
IHolk |
createHolk(String name,
EShipUpgrade upgradeLevel,
int value)
Create a holk with the given name.
|
IHolk |
createHolk(String name,
int value)
Create a a holk with the given name.
|
ISnaikka |
createSnaikka(String name,
EShipUpgrade upgradeLevel,
int value)
Create a snaikka with the given name.
|
ISnaikka |
createSnaikka(String name,
int value)
Create a a snaikka with the given name.
|
private Properties |
getCogDefaultProperties() |
int |
getConstructionAmount(EShipType type,
EWare ware)
Retrieve the amount that is needed for the ship to upgrade to the next level
|
private Properties |
getCrayerDefaultProperties() |
private Properties |
getHolkDefaultProperties() |
int |
getMinimalSailors(EShipType type)
Get the minimum of sailors per ship type.
|
int |
getShipSpeed(EShipType type)
Get the speed of the ship in knots.
|
private Properties |
getSnikkaDefaultProperties() |
int |
getUpgradeAmount(EShipType type,
EWare ware)
Retrieve the amount that is needed for the ship to upgrade to the next level
|
private final org.apache.log4j.Logger logger
@Autowired private Date date
@Autowired private IMap map
@Autowired private org.springframework.context.ApplicationContext context
private static final int SNAIKKA_START_CAPACITY
private static final int SNAIKKA_MAX_CAPACITY
private static final int CRAYER_START_CAPACITY
private static final int CRAYER_MAX_CAPACITY
private static final int COG_START_CAPACITY
private static final int COG_MAX_CAPACITY
private static final int HOLK_START_CAPACITY
private static final int HOLK_MAX_CAPACITY
private Properties getHolkDefaultProperties() throws IOException
IOExceptionprivate Properties getCogDefaultProperties() throws IOException
IOExceptionprivate Properties getCrayerDefaultProperties() throws IOException
IOExceptionprivate Properties getSnikkaDefaultProperties() throws IOException
IOExceptionpublic ICrayer createCrayer(String name, int value)
name - of the shipvalue - size of the shippublic ICrayer createCrayer(String name, EShipUpgrade upgradeLevel, int value)
name - of the shipvalue - size of the shipupgradeLevel - public ISnaikka createSnaikka(String name, int value)
name - of the shipvalue - size of the shippublic ISnaikka createSnaikka(String name, EShipUpgrade upgradeLevel, int value)
name - of the shipvalue - size of the shipupgradeLevel - public ICog createCog(String name, int value)
name - of the shipvalue - size of the shippublic ICog createCog(String name, EShipUpgrade upgradeLevel, int value)
name - of the shipvalue - size of the shipupgradeLevel - public IHolk createHolk(String name, int value)
name - of the shipvalue - size of the shippublic IHolk createHolk(String name, EShipUpgrade upgradeLevel, int value)
name - of the shipvalue - size of the shipupgradeLevel - public int calculateInitialCapacity(EShipType type, double x)
type - ship typex - coordinate on where to build it.public int getUpgradeAmount(EShipType type, EWare ware)
type - ship typeware - that is requiredpublic int getConstructionAmount(EShipType type, EWare ware)
type - ship typeware - that is requiredpublic int getMinimalSailors(EShipType type)
type - of the shippublic int getShipSpeed(EShipType type)
type - of the shipCopyright © 2011-2015 Sahits GmbH. All Rights Reserved.