|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | 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.
Inner classes inherited from class javax.swing.JFrame |
JFrame.AccessibleJFrame |
Inner classes inherited from class java.awt.Frame |
Frame.AccessibleAWTFrame |
Inner classes inherited from class java.awt.Window |
Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent |
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, 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)
Constructor for the Game object |
Method Summary | |
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 |
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 |
connectionLost()
Description of the Method |
void |
destroyPiece(int handle)
Description of the Method |
Piece |
getPieceAt(Point point)
Returns the piece at the given point of the board, or null if no such piece exists. |
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(int x,
int y)
Makes an automaton in the map invisible. |
void |
hideMapPoints(int[] x,
int[] y)
Makes a number of automatons invisible. |
static void |
main(String[] argv)
Main method for program start. |
void |
mapLoadingProgressUpdate(double progress)
Description of the Method |
void |
mapUpdate(int[] x,
int[] y,
int[] colors)
Description of the Method |
void |
mapUpdate(int x,
int y,
int color)
Description of the Method |
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 |
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle |
Methods inherited from class java.awt.Window |
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, show, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFont, validate, validateTree |
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 |
Constructor Detail |
public Game(String gameTitle)
gameTitle
- Description of ParameterMethod Detail |
public Piece getPieceAt(Point point)
point
- Description of Parameterpublic Enumeration getPiecesIntersecting(Rectangle rect)
rect
- Description of Parameterpublic Position getPreferredCenter()
public Enumeration getSelectedPiecePositions()
public void mapUpdate(int[] x, int[] y, int[] colors)
mapUpdate
in interface Client
x
- Description of Parametery
- Description of Parametercolors
- Description of Parameterpublic void mapUpdate(int x, int y, int color)
mapUpdate
in interface Client
x
- Description of Parametery
- Description of Parametercolor
- Description of Parameterpublic void hideMapPoints(int[] x, int[] y)
hideMapPoints
in interface Client
x
- A vector of automaton x coordinates.y
- A vector of automaton y coordinates.public void hideMapPoint(int x, int y)
hideMapPoint
in interface Client
x
- The x coordinate of the automaton.y
- The y 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 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 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 Parametermessage
- Description of Parameterpublic void connectionLost()
connectionLost
in interface Client
public void mapLoadingProgressUpdate(double progress)
mapLoadingProgressUpdate
in interface Client
progress
- Description of Parameterpublic 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(Piece p)
p
- Description of Parameterpublic static void main(String[] argv)
argv
- The command line arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |