ch.sahits.game.openpatrician.model
Class GameFactory
java.lang.Object
ch.sahits.game.openpatrician.model.GameFactory
public class GameFactory
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rnd
private static final Random rnd
GameFactory
public GameFactory()
createPlayer
public static IPlayer createPlayer(String name,
String lastName,
ICity homeTown,
boolean male,
int cash)
- Create a human player instance. Build their trading office in the home town as well.
- Parameters:
name - lastName - homeTown - male -
- Returns:
createAIPlayer
public static IPlayer createAIPlayer(ICity homeTown,
long cash)
- Create an artifiacial player instance. Build their trading office in the home town as well.
- Parameters:
homeTown -
- Returns:
initPlayerInCities
private static void initPlayerInCities(IPlayer player)
- Init the player data in all cities
- Parameters:
player -
createMap
public static IMap createMap()
throws IOException
- Create the standard map with all cities defined in
ECityName
- Returns:
- standard map of the game
- Throws:
IOException - Cities properties could not be read
createGame
public static IGame createGame(IMap map,
EObjective objective,
Difficulty difficulty,
EGameSpeed speed,
int startYear)
computeRandomBirthDate
private static DateObject computeRandomBirthDate(int age)
Copyright © 2011-2012 Sahits GmbH. All Rights Reserved.