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.
-
camera
- The camera for the player.
-
CLIENT
- Client mode.
-
how
- How the strategy is to play.
-
id
- The id String for the player.
-
javaQcam
- The main part of the game.
-
LOCAL
- Local mode.
-
player
- The player of the game.
-
SERVER
- Server mode.
-
StdPlayer()
-
-
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.
-
getCamera()
- Get the camera from the system.
-
how()
-
How the player is setup.
-
howPlay(String[])
- Determines how the strategy is to play.
-
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.
-
makeIt(StdPlayer, String[])
-
Makes the player.
-
post(Buffer)
-
Get the post thread for the player.
-
serverStrategy(Buffer, TextArea, Camera)
-
Get the strategy thread for the player.
SERVER
protected static final String SERVER
- Server mode.
CLIENT
protected static final String CLIENT
- Client mode.
LOCAL
protected static final String LOCAL
- Local mode.
how
protected String how
- How the strategy is to play. Default is local.
javaQcam
protected JavaQcam javaQcam
- The main part of the game.
player
protected StdPlayer player
- The player of the game.
camera
protected Camera camera
- The camera for the player.
id
protected static String id
- The id String for the player.
Used in the log file to keep track of which player played.
StdPlayer
public StdPlayer()
howPlay
public void howPlay(String args[])
- Determines how the strategy is to play.
- Parameters:
- args - Command line arguments.
makeIt
public void makeIt(StdPlayer player,
String args[])
- Makes the player.
- Parameters:
- player - Player to be.
- args - Command line arguments.
how
public String how()
- How the player is setup.
- Returns:
- Player mode status.
getCamera
public Camera getCamera()
- Get the camera from the system.
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.
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.
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.
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.
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.
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.
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.
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.
id
public String id()
- Get id of player.
- Returns:
- id of player.
All Packages Class Hierarchy This Package Previous Next Index