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.
-
id
- The id String for the player.
-
inputDevices
-
-
StdPlayer2()
-
-
analyze(Buffer)
-
Get the analyze thread for the player.
-
clientStrategy(Buffer, TextArea)
-
Get the strategy thread for the player.
-
frameGrabber(Camera, Buffer)
-
Get the frame grabber thread for the player.
-
id()
- Get id of player.
-
localStrategy(Buffer, TextArea, Camera)
-
Get the strategy thread for the player.
-
main(String[])
-
Start up the program.
-
makeBuffers(int, Camera)
- Make the information buffers.
-
post(Buffer)
-
Get the post thread for the player.
-
serverStrategy(Buffer, TextArea, Camera)
-
Get the strategy thread for the player.
inputDevices
protected StandardInputs inputDevices
id
protected static String id
- The id String for the player.
Used in the log file to keep track of which player played.
StdPlayer2
public StdPlayer2()
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.
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
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
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
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
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
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
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
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