All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pinball.player.standardV2.StdPlayer2

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

public class StdPlayer2
extends StdPlayer
The standard player version 2 for the pinball game. It has a separate thread for the image capturing. If a image is not grabbed, the the buffer just passes through the system doing nothing along the way. 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 id
The id String for the player.
 o inputDevices

Constructor Index

 o StdPlayer2()

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 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 post(Buffer)
Get the post thread for the player.
 o serverStrategy(Buffer, TextArea, Camera)
Get the strategy thread for the player.

Variables

 o inputDevices
 protected StandardInputs inputDevices
 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 StdPlayer2
 public StdPlayer2()

Methods

 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.

 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.
Overrides:
makeBuffers in class StdPlayer
 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.
Overrides:
analyze in class StdPlayer
 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.
Overrides:
frameGrabber in class StdPlayer
 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.
Overrides:
localStrategy in class StdPlayer
 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.
Overrides:
clientStrategy in class StdPlayer
 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.
Overrides:
serverStrategy in class StdPlayer
 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.
Overrides:
post in class StdPlayer
 o id
 public String id()
Get id of player.

Returns:
id of player.
Overrides:
id in class StdPlayer

All Packages  Class Hierarchy  This Package  Previous  Next  Index