@Lazy @Component public class GameFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
private NonReplacableMap<String,Object> |
beanMap |
private BuildingFactory |
buildingFactory |
private CityFactory |
cityFactory |
private List<CityState> |
cityStates |
private org.springframework.context.ApplicationContext |
context |
private Date |
date |
private Random |
rnd |
| Constructor and Description |
|---|
GameFactory() |
| Modifier and Type | Method and Description |
|---|---|
private org.joda.time.DateTime |
computeRandomBirthDate(int age) |
IAIPlayer |
createAIPlayer(ICity homeTown,
long cash)
Create an artifiacial player instance.
|
ICompany |
createCompany(IPlayer owner,
ICity homeTown,
long cash) |
IGame |
createGame(IMap map,
EObjective objective,
Difficulty difficulty,
EGameSpeed speed,
int startYear) |
IMap |
createMap(String mapName)
Create the map with all cities defined in its XML definition
|
IPlayer |
createPlayer(String name,
String lastName,
ICity homeTown,
boolean male,
int cash)
Create a human player instance.
|
CityState |
getCityState(ICity city)
Retrieve the city state for the city.
|
IGame |
getGame() |
ReputationCalculator |
getReputationCalculator() |
private CityState |
initCityPropertyState(ICity city) |
private void |
initPlayerInCities(IPlayer player)
Init the player data in all cities
|
@Autowired private Random rnd
@Autowired private CityFactory cityFactory
@Autowired private Date date
@Autowired private BuildingFactory buildingFactory
private NonReplacableMap<String,Object> beanMap
@Autowired private org.springframework.context.ApplicationContext context
public IPlayer createPlayer(String name, String lastName, ICity homeTown, boolean male, int cash)
name - lastName - homeTown - male - public IAIPlayer createAIPlayer(ICity homeTown, long cash)
homeTown - private void initPlayerInCities(IPlayer player)
player - public IMap createMap(String mapName) throws IOException
IOException - Cities properties could not be readpublic IGame createGame(IMap map, EObjective objective, Difficulty difficulty, EGameSpeed speed, int startYear)
public IGame getGame()
private org.joda.time.DateTime computeRandomBirthDate(int age)
public CityState getCityState(ICity city)
city - public ReputationCalculator getReputationCalculator()
Copyright © 2011-2015 Sahits GmbH. All Rights Reserved.