public class GameFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
private AIPlayerList |
aiPlayers |
private NonReplacableMap<String,Object> |
beanMap |
private BuildingFactory |
buildingFactory |
private CityFactory |
cityFactory |
private CityRegistry |
cityRegistry |
private org.springframework.context.ApplicationContext |
context |
private Date |
date |
private org.apache.logging.log4j.Logger |
logger |
private PlayerList |
players |
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,
boolean singleplayer) |
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
|
private final org.apache.logging.log4j.Logger logger
@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
@Autowired private CityRegistry cityRegistry
@Autowired private PlayerList players
@Autowired private AIPlayerList aiPlayers
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, boolean singleplayer)
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.