rl.leviathan.game
Class LeviathanGame

java.lang.Object
  extended by rl.common.game.Game
      extended by rl.leviathan.game.LeviathanGame
All Implemented Interfaces:
LeviathanElementVisibilityListener, GameLogger

public class LeviathanGame
extends Game
implements LeviathanElementVisibilityListener


Constructor Summary
LeviathanGame()
           
 
Method Summary
 void addListener(LeviathanGameListener l)
           
 void completeTurn(LeviathanGameTurn turn)
           
protected  void completeUnitLocationPlacement(Player p)
          Places all unplaced units along the further most edge of the deployment zone.
 void elementRemoved(Player p, GameElementIdentifier ge)
           
 void elementVisible(Player p, Location l, Affiliation aff)
           
 Commander getCommanderForPlayer(long connectionID)
           
 Commander getCommanderForSide(LeviathanGameSide side)
           
 LeviathanGameTurn getCurrentTurn()
           
 int getCurrentTurnNumber()
           
 LeviathanElementVisibility getElementVisibility()
           
 Location getLocationForGameElement(GameElement ge)
           
 Location getLocationForGameElement(GameElementIdentifier geID)
           
protected  GameSide getNewGameSide(java.lang.String name)
           
 boolean hasGameStarted()
           
protected  boolean hasLocationForGameElement(GameElement ge)
           
protected  boolean hasLocationForGameElement(GameElementIdentifier geID)
           
 boolean isValidLocationForElement(GameElementIdentifier geID, Location location)
           
 void loadScenario(Scenario scenario)
           
 void placeGameElement(GameElementIdentifier geID, Location location)
           
 void playerSetupComplete()
           
 void removeListener(LeviathanGameListener l)
           
 void resolveGameElementMovementOrders(MovementOrderSequence mos)
          Movement Order Resolution
 void setCommanderForSide(LeviathanGameSide side, Commander commander)
          sets the Commander for the side.
protected  void startGame()
           
 void unplaceGameElement(GameElementIdentifier geID)
           
 
Methods inherited from class rl.common.game.Game
addListener, addObserver, addPlayer, checkGameReadyToPlay, forcesSelected, gameElementPlacementComplete, getAttacker, getBattleType, getBoard, getCombatUnitsForPlayer, getCurrentPhase, getDescription, getGameElement, getGameLength, getGameSide, getGameSideOne, getGameSideTwo, getLastActivity, getName, getObserverCount, getObserversAllowed, getOpposingSideForPlayer, getPlayer, getPlayerCount, getPlayerForElement, getRaceSelectionAllowed, getSideForPlayer, getThemeName, getTime, getUnallocatedPlayers, getUnitsForPlayer, getWeather, isSideOne, isSideTwo, log, notifyGameDrawn, notifyGameLost, notifyGamePhase, notifyGameWon, phaseCompleted, removeListener, removeObserver, removePlayer, setBoard, setBoard, setGameLogger, setObserversAllowed, setRaceSelectionAllowed, updateActive, victoryConditionsSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeviathanGame

public LeviathanGame()
Method Detail

addListener

public void addListener(LeviathanGameListener l)

removeListener

public void removeListener(LeviathanGameListener l)

getCurrentTurn

public LeviathanGameTurn getCurrentTurn()

getElementVisibility

public LeviathanElementVisibility getElementVisibility()

hasGameStarted

public boolean hasGameStarted()
Specified by:
hasGameStarted in class Game

getCurrentTurnNumber

public int getCurrentTurnNumber()
Specified by:
getCurrentTurnNumber in class Game

getCommanderForPlayer

public Commander getCommanderForPlayer(long connectionID)
                                throws java.lang.Exception
Throws:
java.lang.Exception

getCommanderForSide

public Commander getCommanderForSide(LeviathanGameSide side)
                              throws java.lang.Exception
Throws:
java.lang.Exception

loadScenario

public void loadScenario(Scenario scenario)
                  throws java.lang.Exception
Overrides:
loadScenario in class Game
Throws:
java.lang.Exception

getNewGameSide

protected GameSide getNewGameSide(java.lang.String name)
Specified by:
getNewGameSide in class Game

isValidLocationForElement

public boolean isValidLocationForElement(GameElementIdentifier geID,
                                         Location location)
Specified by:
isValidLocationForElement in class Game

setCommanderForSide

public void setCommanderForSide(LeviathanGameSide side,
                                Commander commander)
                         throws java.lang.Exception
sets the Commander for the side. This is the commander who's rating the Command Point Advantage is calculated off.

Parameters:
side - The side to assign the commander
commander - The commander to assign
Throws:
java.lang.Exception

completeUnitLocationPlacement

protected void completeUnitLocationPlacement(Player p)
Places all unplaced units along the further most edge of the deployment zone. Players complaining about where their units get automatically placed should be encouraged to place them manually instead :D

Specified by:
completeUnitLocationPlacement in class Game

playerSetupComplete

public void playerSetupComplete()
Overrides:
playerSetupComplete in class Game

startGame

protected void startGame()
Specified by:
startGame in class Game

completeTurn

public void completeTurn(LeviathanGameTurn turn)

hasLocationForGameElement

protected boolean hasLocationForGameElement(GameElement ge)

hasLocationForGameElement

protected boolean hasLocationForGameElement(GameElementIdentifier geID)
Specified by:
hasLocationForGameElement in class Game

getLocationForGameElement

public Location getLocationForGameElement(GameElement ge)

getLocationForGameElement

public Location getLocationForGameElement(GameElementIdentifier geID)
Specified by:
getLocationForGameElement in class Game

placeGameElement

public void placeGameElement(GameElementIdentifier geID,
                             Location location)
                      throws java.lang.Exception
Specified by:
placeGameElement in class Game
Throws:
java.lang.Exception

unplaceGameElement

public void unplaceGameElement(GameElementIdentifier geID)
                        throws java.lang.Exception
Specified by:
unplaceGameElement in class Game
Throws:
java.lang.Exception

elementVisible

public void elementVisible(Player p,
                           Location l,
                           Affiliation aff)
Specified by:
elementVisible in interface LeviathanElementVisibilityListener

elementRemoved

public void elementRemoved(Player p,
                           GameElementIdentifier ge)
Specified by:
elementRemoved in interface LeviathanElementVisibilityListener

resolveGameElementMovementOrders

public void resolveGameElementMovementOrders(MovementOrderSequence mos)
Movement Order Resolution

Specified by:
resolveGameElementMovementOrders in class Game