All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pinball.player.standard.StdPlayer

java.lang.Object
   |
   +----pinball.player.standard.StdPlayer

public class StdPlayer
extends Object
The standard player class for the pinball game. This class defines what threads a player will use in the system. It also determines what mode the player will be in. When starting up it takes the following command line arguments to define it's mode.

-s for server mode.

-c for client mode.

If none of these are specified, then the player is in local mode.

There are four other command line arguements allowed.

-LPath for the log file. Path is the location to write the log file too. You must include a / at the end of the path location.

-lpath will do the log file without saving the frames from the camera.

-Ffile is the location of the flipper file. This stores the positions of the flippers. Use this if you plan on restarting the system many times, to skip the flipper location phase.


Variable Index

 o camera
The camera for the player.
 o CLIENT
Client mode.
 o how
How the strategy is to play.
 o id
The id String for the player.
 o javaQcam
The main part of the game.
 o LOCAL
Local mode.
 o player
The player of the game.
 o SERVER
Server mode.

Constructor Index

 o StdPlayer()

Method Index

 o analyze(Buffer)
Get the analyze thread for the player.
 o clientStrategy(Buffer, TextArea)
Get the strategy thread for the player.
 o frameGrabber(Camera, Buffer)
Get the frame grabber thread for the player.
 o getCamera()
Get the camera from the system.
 o how()
How the player is setup.
 o howPlay(String[])
Determines how the strategy is to play.
 o id()
Get id of player.
 o localStrategy(Buffer, TextArea, Camera)
Get the strategy thread for the player.
 o main(String[])
Start up the program.
 o makeBuffers(int, Camera)
Make the information buffers.
 o makeIt(StdPlayer, String[])
Makes the player.
 o post(Buffer)
Get the post thread for the player.
 o serverStrategy(Buffer, TextArea, Camera)
Get the strategy thread for the player.

Variables

 o SERVER
 protected static final String SERVER
Server mode.

 o CLIENT
 protected static final String CLIENT
Client mode.

 o LOCAL
 protected static final String LOCAL
Local mode.

 o how
 protected String how
How the strategy is to play. Default is local.

 o javaQcam
 protected JavaQcam javaQcam
The main part of the game.

 o player
 protected StdPlayer player
The player of the game.

 o camera
 protected Camera camera
The camera for the player.

 o id
 protected static String id
The id String for the player. Used in the log file to keep track of which player played.

Constructors

 o StdPlayer
 public StdPlayer()

Methods

 o howPlay
 public void howPlay(String args[])
Determines how the strategy is to play.

Parameters:
args - Command line arguments.
 o makeIt
 public void makeIt(StdPlayer player,
                    String args[])
Makes the player.

Parameters:
player - Player to be.
args - Command line arguments.
 o how
 public String how()
How the player is setup.

Returns:
Player mode status.
 o getCamera
 public Camera getCamera()
Get the camera from the system.

 o makeBuffers
 public Buffer makeBuffers(int amount,
                           Camera Qcam)
Make the information buffers. Return the first of the list.

Parameters:
amount - The amount of buffers to create.
Qcam - The camera.
Returns:
the first of the list.
 o main
 public static void main(String args[])
Start up the program. Takes command line arguments. Takes the following command line arguments: -s for server mode. -c for client mode. -S for server mode.

 o analyze
 public Analyze analyze(Buffer buffer)
Get the analyze thread for the player.

Parameters:
buffer - the first buffer in the series of buffers for the system.
Returns:
Analyze thread.
 o frameGrabber
 public FrameGrabber frameGrabber(Camera Qcam,
                                  Buffer buffer)
Get the frame grabber thread for the player.

Parameters:
Qcam - the camera.
buffer - the first buffer in the series of buffers for the system.
window - the window to draw to.
Returns:
frame grabber thread.
 o localStrategy
 public Strategy localStrategy(Buffer buffer,
                               TextArea gameStats,
                               Camera camera)
Get the strategy thread for the player.

Parameters:
buffer - the first buffer in the series of buffers for the system.
gameStats - the area to write the game stats to.
camera - the camera for the system.
Returns:
strategy thread.
 o clientStrategy
 public Strategy clientStrategy(Buffer buffer,
                                TextArea gameStats)
Get the strategy thread for the player.

Parameters:
buffer - the first buffer in the series of buffers for the system.
gameStats - the area to write the game stats to.
Returns:
strategy thread.
 o serverStrategy
 public Strategy serverStrategy(Buffer buffer,
                                TextArea gameStats,
                                Camera camera)
Get the strategy thread for the player.

Parameters:
buffer - the first buffer in the series of buffers for the system.
gameStats - the area to write the game stats to.
camera - the camera for the system.
Returns:
strategy thread.
 o post
 public Post post(Buffer buffer)
Get the post thread for the player.

Parameters:
buffer - the first buffer in the series of buffers for the system.
Returns:
strategy thread.
 o id
 public String id()
Get id of player.

Returns:
id of player.

All Packages  Class Hierarchy  This Package  Previous  Next  Index