edu.lmu.lmusleuth
Interface Game

All Superinterfaces:
GameChangeListener

public interface Game
extends GameChangeListener

All lmusleuth game objects should support these methods. This interface enables lmusleuth implementations and subsystems to make use of the GameChangeListener interface.


Method Summary
 void addGameChangeListener(GameChangeListener gcl)
          Add a game change listener to the game.
 void addPlayer(Player p)
          Add a player to the Game.
 void chat(Player p, java.lang.String message)
          The player wants to send this message to everyone in this game.
 Player getCurrentPlayer()
          Get the player whose turn it is in this game.
 java.lang.String getName()
          Get the name of this game.
 java.util.List getPlayers()
          Get the list of players that are currently in this game.
 boolean isOver()
          Returns whether or not this game is over.
 boolean isStarted()
          Returns whether or not the game has started.
 void makeAssertion(Player p, Evidence.Suspect who, Evidence.Room where, Evidence.Weapon what)
          The given player is making an assertion about these pieces of evidence.
 void makeHypothesis(Player p, Evidence.Suspect who, Evidence.Room where, Evidence.Weapon what)
          The given player is making an hypothesis about these pieces of evidence.
 void move(Player p, Location l)
          The player wants to move (their suspect) to the given location.
 void refute(Player p, Evidence evidence)
          Refute the hypothesis with the given evidence.
 void removeGameChangeListener(GameChangeListener gcl)
          Removes a game change listener to the game.
 void removePlayer(Player p)
          Remove the given player from this Game.
 void spin(Player p)
          The player wants to spin the spinner.
 
Methods inherited from interface edu.lmu.lmusleuth.GameChangeListener
askRefute, assertion, beginTurn, chat, clearStartVotes, endTurn, hypothesis, lose, move, newPlayer, newPlayerSuspect, playerQuit, refuted, refuted, spin, spin, unableToRefute, voteStart, win
 

Method Detail

addPlayer

public void addPlayer(Player p)
Add a player to the Game.


removePlayer

public void removePlayer(Player p)
Remove the given player from this Game.


getPlayers

public java.util.List getPlayers()
Get the list of players that are currently in this game.


addGameChangeListener

public void addGameChangeListener(GameChangeListener gcl)
Add a game change listener to the game. The GameChangeListener will be added to the Game's list of interested listeners and will begin to receive updates on the activity in this game. WARNING: Even though Game implements GameChangeListener it is not recommended that you add the game to itself.


removeGameChangeListener

public void removeGameChangeListener(GameChangeListener gcl)
Removes a game change listener to the game. The given listener is officially disinterested in the changes that occur to this game.


getCurrentPlayer

public Player getCurrentPlayer()
                        throws java.lang.IllegalStateException
Get the player whose turn it is in this game. If this game isn't currently running, this method will throw the state exception.

java.lang.IllegalStateException

makeHypothesis

public void makeHypothesis(Player p,
                           Evidence.Suspect who,
                           Evidence.Room where,
                           Evidence.Weapon what)
                    throws java.lang.IllegalStateException
The given player is making an hypothesis about these pieces of evidence.

java.lang.IllegalStateException

makeAssertion

public void makeAssertion(Player p,
                          Evidence.Suspect who,
                          Evidence.Room where,
                          Evidence.Weapon what)
                   throws java.lang.IllegalStateException
The given player is making an assertion about these pieces of evidence.

java.lang.IllegalStateException

refute

public void refute(Player p,
                   Evidence evidence)
            throws java.lang.IllegalStateException
Refute the hypothesis with the given evidence. The player must be in proper posession of the evidence in order to make a refutation.

java.lang.IllegalStateException

spin

public void spin(Player p)
The player wants to spin the spinner.


move

public void move(Player p,
                 Location l)
The player wants to move (their suspect) to the given location.


chat

public void chat(Player p,
                 java.lang.String message)
The player wants to send this message to everyone in this game.


getName

public java.lang.String getName()
Get the name of this game.


isStarted

public boolean isStarted()
Returns whether or not the game has started. This, in effect, tells whether or not the first player's turn has begun.


isOver

public boolean isOver()
Returns whether or not this game is over. The game is over once someone has won the game.