nanomunchers
Class NanoSystemAnalyzer

java.lang.Object
  extended bynanomunchers.NanoSystemAnalyzer
All Implemented Interfaces:
heurgame.analysis.SystemAnalyzer

public class NanoSystemAnalyzer
extends java.lang.Object
implements heurgame.analysis.SystemAnalyzer

Ensures legal moves and runs the simulation the first time.

Author:
David Kaplin

Constructor Summary
NanoSystemAnalyzer()
           
 
Method Summary
 Graph getBoard()
           
 heurgame.analysis.MoveAnalyzer getMoveAnalyzer()
           
 java.lang.String getResponse(heurgame.PlayerToken owner, NanoBot newBot)
          Used to get a response about error conditions.
 heurgame.PlayerToken getWinningPlayer()
           
 heurgame.PlayerToken[] getWinningPlayers()
           
 boolean isDecisive()
           
 boolean isGameOver()
           
 boolean needMore(heurgame.PlayerToken owner)
          Ensures everyone plays with the correct number of nanomunchers.
 void newGame()
           
 void runSimulation(java.util.Vector playerTokens)
           
 void setup(int maxBots, Graph nanoField, NanoSimulation ui)
          Initalizes objects related to the system as a whole.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NanoSystemAnalyzer

public NanoSystemAnalyzer()
Method Detail

getBoard

public Graph getBoard()
Returns:
related to the game

needMore

public boolean needMore(heurgame.PlayerToken owner)
Ensures everyone plays with the correct number of nanomunchers.

Parameters:
owner - in question
Returns:
true if the owner has not placed the required number of nanobots.

getResponse

public java.lang.String getResponse(heurgame.PlayerToken owner,
                                    NanoBot newBot)
Used to get a response about error conditions.

Parameters:
owner - in question
newBot - in question
Returns:
a variety of error conditions.

setup

public void setup(int maxBots,
                  Graph nanoField,
                  NanoSimulation ui)
Initalizes objects related to the system as a whole.

Parameters:
maxBots - desired allocation of nanomunchers per player
nanoField - where the game will be played.
ui - to be associated with the simulator.

runSimulation

public void runSimulation(java.util.Vector playerTokens)
Parameters:
playerTokens - players to be used in the simulation

isGameOver

public boolean isGameOver()
Specified by:
isGameOver in interface heurgame.analysis.SystemAnalyzer
See Also:
SystemAnalyzer.isGameOver()

isDecisive

public boolean isDecisive()
Specified by:
isDecisive in interface heurgame.analysis.SystemAnalyzer
See Also:
SystemAnalyzer.isDecisive()

getWinningPlayer

public heurgame.PlayerToken getWinningPlayer()
Specified by:
getWinningPlayer in interface heurgame.analysis.SystemAnalyzer
See Also:
SystemAnalyzer.getWinningPlayer()

getWinningPlayers

public heurgame.PlayerToken[] getWinningPlayers()
Specified by:
getWinningPlayers in interface heurgame.analysis.SystemAnalyzer
See Also:
SystemAnalyzer.getWinningPlayers()

newGame

public void newGame()
Specified by:
newGame in interface heurgame.analysis.SystemAnalyzer
See Also:
SystemAnalyzer.newGame()

getMoveAnalyzer

public heurgame.analysis.MoveAnalyzer getMoveAnalyzer()
Specified by:
getMoveAnalyzer in interface heurgame.analysis.SystemAnalyzer
See Also:
SystemAnalyzer.getMoveAnalyzer()