public class GameFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
private AIPlayerList |
aiPlayers |
private BuildingFactory |
buildingFactory |
private CityFactory |
cityFactory |
private CityRegistry |
cityRegistry |
private org.springframework.context.ApplicationContext |
context |
private Date |
date |
private IGame |
game |
private ILocationTracker |
locationTracker |
private org.apache.logging.log4j.Logger |
logger |
private IMapSegmentImageCreator |
mapLoader |
private PlayerList |
players |
protected com.google.common.collect.Interner<javafx.geometry.Point2D> |
pointInterner |
private Random |
rnd |
private ShipFactory |
shipFactory |
private RandomNameLoader |
shipNameLoader |
| 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
|
IHumanPlayer |
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 IGame game
@Autowired private org.springframework.context.ApplicationContext context
@Autowired private CityRegistry cityRegistry
@Autowired private PlayerList players
@Autowired private AIPlayerList aiPlayers
@Autowired @Qualifier(value="shipNameLoader") private RandomNameLoader shipNameLoader
@Autowired private ShipFactory shipFactory
@Autowired private IMapSegmentImageCreator mapLoader
@Autowired protected com.google.common.collect.Interner<javafx.geometry.Point2D> pointInterner
private ILocationTracker locationTracker
public IHumanPlayer 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-2016 Sahits GmbH. All Rights Reserved.