dk.brics.bisimulationGame.controller
Class Controller

java.lang.Object
  extended by dk.brics.bisimulationGame.controller.Controller

public class Controller
extends java.lang.Object

Main local controller. When a game starts: 1. Check the game type: a. 2p remote, server: Setup a RMI registry and bind global objects (globalModel, messagePasser). b. 2p remote, client: Locate a remote registry at the specified host and retrieve the remote objects. c. Local game: The game controller still talks to the message passer, and if it's a 1p game, a computer player thread is started, which also talks to the message passer.

When a game ends: 1. If an AI thread is running, tell it to quit. 2. If the player is a server, unbind the remote objects. 3. If the player is a client, nullify the registry.

Author:
Martin Mosegaard martinm@daimi.au.dk

Constructor Summary
Controller(OptionsModel optionsModel, View view)
           
 
Method Summary
 void quitGame()
          Invoked by the game communicator when the (local) player wants to quit a game.
 void startGame()
          Invoked by the options controller.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

public Controller(OptionsModel optionsModel,
                  View view)
Method Detail

startGame

public void startGame()
Invoked by the options controller. Starts a new game.


quitGame

public void quitGame()
Invoked by the game communicator when the (local) player wants to quit a game. Switch from game view to options view.