ch.sahits.game.openpatrician.model
Class Game

java.lang.Object
  extended by ch.sahits.game.openpatrician.model.Game
All Implemented Interfaces:
IEventListener, IGame

 class Game
extends Object
implements IGame, IEventListener

Implementation of the game

Author:
Andi Hotz, (c) Sahits GmbH, 2011 Created on Sep 16, 2011

Field Summary
private  Difficulty difficulty
           
private  Date gameTime
           
private  IMap map
           
private  EObjective objective
           
private  EGameSpeed speed
           
 
Constructor Summary
Game(IMap map, EObjective objective, Difficulty difficulty, EGameSpeed speed, Date gameTime)
           
 
Method Summary
 void gameUpdate(Event e, Object eventNotice)
           
 Difficulty getDifficulty()
          Retrieve the difficultiy level of the game
 EGameSpeed getGameSpeed()
          Retrieve the current game speed
 IMap getMap()
          Retrieve the map
 Date getTime()
          Retrieve the game time
 boolean isObjectivReached()
          check if the objective of the game is reached.
 void setGameSpeed(EGameSpeed speed)
          Set a new game speed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

private final IMap map

objective

private final EObjective objective

difficulty

private final Difficulty difficulty

speed

private EGameSpeed speed

gameTime

private Date gameTime
Constructor Detail

Game

public Game(IMap map,
            EObjective objective,
            Difficulty difficulty,
            EGameSpeed speed,
            Date gameTime)
Method Detail

getMap

public IMap getMap()
Description copied from interface: IGame
Retrieve the map

Specified by:
getMap in interface IGame
Returns:

isObjectivReached

public boolean isObjectivReached()
Description copied from interface: IGame
check if the objective of the game is reached. This method may not be called by the server part

Specified by:
isObjectivReached in interface IGame
Returns:

setGameSpeed

public void setGameSpeed(EGameSpeed speed)
Description copied from interface: IGame
Set a new game speed

Specified by:
setGameSpeed in interface IGame

getGameSpeed

public EGameSpeed getGameSpeed()
Description copied from interface: IGame
Retrieve the current game speed

Specified by:
getGameSpeed in interface IGame
Returns:

getDifficulty

public Difficulty getDifficulty()
Description copied from interface: IGame
Retrieve the difficultiy level of the game

Specified by:
getDifficulty in interface IGame
Returns:

getTime

public Date getTime()
Description copied from interface: IGame
Retrieve the game time

Specified by:
getTime in interface IGame
Returns:

gameUpdate

public void gameUpdate(Event e,
                       Object eventNotice)
Specified by:
gameUpdate in interface IEventListener


Copyright © 2011-2012 Sahits GmbH. All Rights Reserved.