|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Frame | +--javax.swing.JFrame | +--gecco.client.Game
This is the main game class. It contains the complete client for an arbitrary game.
Field Summary | |
static boolean |
LOG
|
Fields inherited from class javax.swing.JFrame |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Game(String gameTitle,
CommandLineProperties prop)
Constructor for the Game object |
Method Summary | |
void |
abortAllActions(int pieceHandle)
|
void |
abortExecutingAction(Piece p)
Aborts the currently executing action of the given piece. |
void |
abortExecutingAction(Piece p,
boolean abortAll)
Aborts the currently executing action of the given piece. |
void |
abortExecutingAction(Set s)
abortExecutingAction support method for multi selection of pieces |
void |
abortQueuedActionLog(Action a)
|
void |
actionReply(long id,
boolean ok)
Description of the Method |
void |
addPiece(int handle,
String name,
Position pos,
Set actions,
Map properties,
String type)
Adds the specified piece, as described in Client.java. |
void |
addPieceAction(int handle,
Action a)
Adds a feature to the PieceAction attribute of the Game object |
void |
animationDone(AnimatedPiece p)
Description of the Method |
void |
assureMinimumSpread(Piece p,
Position pos)
|
void |
coffeeBreak(String message)
|
void |
connectionLost()
Description of the Method |
void |
destroyPiece(int handle)
Description of the Method |
void |
gameOver(String message)
|
Piece |
getPieceAt(Point point)
Returns the piece at the given point of the board, or null if no such piece exists. |
Enumeration |
getPiecePositions(Piece piece)
|
Enumeration |
getPiecesIntersecting(Rectangle rect)
Returns all pieces of the game that intersect the given rectangle. |
Position |
getPreferredCenter()
Returns the preferred center of the map. |
Enumeration |
getSelectedPiecePositions()
Returns the positions of the queued actions (and the currently executing action) of the selected piece, or NULL if no piece is selected. |
void |
hideMapPoint(Point p)
Makes an automaton in the map invisible. |
void |
hideMapPoints(Point[] points)
Makes a number of automatons invisible. |
boolean |
isSelectedPropertiesBlocked()
Get the SelectedPropertiesBlocked value. |
static void |
main(String[] args)
Main method for program start. |
void |
mapLoadingProgressUpdate(double progress)
Description of the Method |
void |
mapUpdate(Point[] points,
int[] colors)
Description of the Method |
void |
mapUpdate(Point p,
int color)
Description of the Method |
void |
pieceInfoLog(Piece p)
|
protected void |
playAudioClip(AudioClip clip)
|
void |
removePiece(int handle)
Description of the Method |
void |
removePieceAction(int handle,
Action a)
Description of the Method |
void |
repaintAnimation(AnimatedPiece p)
Description of the Method |
void |
timeUpdate(String time)
Description of the Method |
void |
unitMessage(int handle,
String message)
Description of the Method |
void |
updatePiece(int handle,
Position newPosition)
Description of the Method |
void |
updatePiece(int handle,
Property[] newProperties)
Description of the Method |
void |
warningMessage(String message)
|
void |
zoomInfoLog(String direction)
|
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
public static final boolean LOG
Constructor Detail |
public Game(String gameTitle, CommandLineProperties prop)
gameTitle
- Description of ParameterMethod Detail |
protected void playAudioClip(AudioClip clip)
public Piece getPieceAt(Point point)
point
- Description of Parameter
public Enumeration getPiecesIntersecting(Rectangle rect)
rect
- Description of Parameter
public Position getPreferredCenter()
public Enumeration getSelectedPiecePositions()
public Enumeration getPiecePositions(Piece piece)
public boolean isSelectedPropertiesBlocked()
public void mapUpdate(Point[] points, int[] colors)
mapUpdate
in interface Client
points
- Description of Parametercolors
- Description of Parameterpublic void mapUpdate(Point p, int color)
mapUpdate
in interface Client
p
- Description of Parametercolor
- Description of Parameterpublic void hideMapPoints(Point[] points)
hideMapPoints
in interface Client
points
- A vector of automaton coordinates.public void hideMapPoint(Point p)
hideMapPoint
in interface Client
p
- The coordinate of the automaton.public void unitMessage(int handle, String message)
unitMessage
in interface Client
handle
- Description of Parametermessage
- Description of Parameterpublic void timeUpdate(String time)
timeUpdate
in interface Client
time
- Description of Parameterpublic void warningMessage(String message)
public void addPiece(int handle, String name, Position pos, Set actions, Map properties, String type)
addPiece
in interface Client
handle
- The feature to be added to the Piece attributename
- The feature to be added to the Piece attributepos
- The feature to be added to the Piece attributeactions
- The feature to be added to the Piece attributeproperties
- The feature to be added to the Piece attributetype
- The feature to be added to the Piece attributepublic void updatePiece(int handle, Property[] newProperties)
updatePiece
in interface Client
handle
- Description of ParameternewProperties
- Description of Parameterpublic void updatePiece(int handle, Position newPosition)
updatePiece
in interface Client
handle
- Description of ParameternewPosition
- Description of Parameterpublic void assureMinimumSpread(Piece p, Position pos)
public void pieceInfoLog(Piece p)
public void abortQueuedActionLog(Action a)
public void zoomInfoLog(String direction)
public void removePiece(int handle)
removePiece
in interface Client
handle
- Description of Parameterpublic void destroyPiece(int handle)
destroyPiece
in interface Client
handle
- Description of Parameterpublic void addPieceAction(int handle, Action a)
addPieceAction
in interface Client
handle
- The feature to be added to the PieceAction attributea
- The feature to be added to the PieceAction attributepublic void removePieceAction(int handle, Action a)
removePieceAction
in interface Client
handle
- Description of Parametera
- Description of Parameterpublic void actionReply(long id, boolean ok)
actionReply
in interface Client
id
- Description of Parameterok
- Description of Parameterpublic void connectionLost()
connectionLost
in interface Client
public void mapLoadingProgressUpdate(double progress)
mapLoadingProgressUpdate
in interface Client
progress
- Description of Parameterpublic void abortAllActions(int pieceHandle)
abortAllActions
in interface Client
public void repaintAnimation(AnimatedPiece p)
repaintAnimation
in interface Animator
p
- Description of Parameterpublic void animationDone(AnimatedPiece p)
animationDone
in interface Animator
p
- Description of Parameterpublic void abortExecutingAction(Piece p, boolean abortAll)
p
- The piece.abortAll
- Indiactes whether or not all executing actions should
be aborted.public void abortExecutingAction(Set s)
abortExecutingAction
support method for multi selection of pieces
s
- a Set
containing Piece
public void abortExecutingAction(Piece p)
p
- Description of Parameterpublic void gameOver(String message)
gameOver
in interface Client
public void coffeeBreak(String message)
coffeeBreak
in interface Client
public static void main(String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |