ch.sahits.game.openpatrician.model
Class GameFactory

java.lang.Object
  extended by ch.sahits.game.openpatrician.model.GameFactory

public class GameFactory
extends Object


Field Summary
private static Random rnd
           
 
Constructor Summary
GameFactory()
           
 
Method Summary
private static DateObject computeRandomBirthDate(int age)
           
static IPlayer createAIPlayer(ICity homeTown, long cash)
          Create an artifiacial player instance.
static IGame createGame(IMap map, EObjective objective, Difficulty difficulty, EGameSpeed speed, int startYear)
           
static IMap createMap()
          Create the standard map with all cities defined in ECityName
static IPlayer createPlayer(String name, String lastName, ICity homeTown, boolean male, int cash)
          Create a human player instance.
private static void initPlayerInCities(IPlayer player)
          Init the player data in all cities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rnd

private static final Random rnd
Constructor Detail

GameFactory

public GameFactory()
Method Detail

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.