rl.centurion.game
Class CenturionGame

java.lang.Object
  extended by rl.common.game.Game
      extended by rl.centurion.game.CenturionGame
All Implemented Interfaces:
CenturionElementVisibilityListener, GameLogger

public class CenturionGame
extends Game
implements CenturionElementVisibilityListener


Constructor Summary
CenturionGame()
           
 
Method Summary
 void addListener(CenturionGameListener l)
           
 void completeTurn(CenturionGameTurn turn)
           
protected  void completeUnitLocationPlacement(Player p)
          Places all unplaced units along the further most edge of the deployment zone.
 void elementNoLongerVisible(Player p, Location l, Affiliation aff)
           
 void elementRemoved(Player p, GameElementIdentifier ge)
           
 void elementVisible(Player p, Location l, Affiliation aff)
           
 Commander getCommanderForPlayer(long connectionID)
           
 Commander getCommanderForSide(CenturionGameSide side)
           
 CenturionGameTurn getCurrentTurn()
           
 int getCurrentTurnNumber()
           
 CenturionElementVisibility 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 element, Location location)
           
 void loadScenario(Scenario scenario)
           
 void placeGameElement(GameElementIdentifier elementID, Location location)
           
 void playerSetupComplete()
           
 void removeListener(CenturionGameListener l)
           
 void resolveGameElementMovementOrders(MovementOrderSequence mos)
           
protected  void setBoard(Board board)
           
 void setCommanderForSide(CenturionGameSide side, Commander commander)
          sets the Commander for the side.
protected  void startGame()
           
 void unplaceGameElement(GameElementIdentifier elementID)
           
 
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, 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

CenturionGame

public CenturionGame()
Method Detail

setBoard

protected void setBoard(Board board)
Overrides:
setBoard in class Game

playerSetupComplete

public void playerSetupComplete()
Overrides:
playerSetupComplete in class Game

addListener

public void addListener(CenturionGameListener l)

removeListener

public void removeListener(CenturionGameListener l)

getCurrentTurn

public CenturionGameTurn getCurrentTurn()

hasGameStarted

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

getCurrentTurnNumber

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

getElementVisibility

public CenturionElementVisibility getElementVisibility()

getCommanderForPlayer

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

getCommanderForSide

public Commander getCommanderForSide(CenturionGameSide 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

placeGameElement

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

unplaceGameElement

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

isValidLocationForElement

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

setCommanderForSide

public void setCommanderForSide(CenturionGameSide 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

startGame

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

completeTurn

public void completeTurn(CenturionGameTurn turn)

hasLocationForGameElement

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

hasLocationForGameElement

protected boolean hasLocationForGameElement(GameElement ge)

getLocationForGameElement

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

getLocationForGameElement

public Location getLocationForGameElement(GameElement ge)

elementVisible

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

elementNoLongerVisible

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

elementRemoved

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

resolveGameElementMovementOrders

public void resolveGameElementMovementOrders(MovementOrderSequence mos)
Specified by:
resolveGameElementMovementOrders in class Game