|
||||||||||
| 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.Panel
|
+--java.applet.Applet
|
+--Game
Main class to handle the switching between game modes, and initiation of the game.
Grid,
Battle,
Shop,
PlayerLoader,
PlayerSaver,
MapLoader,
Serialized Form| Field Summary |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
Game()
|
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Handle Button clicks to load, start a new game, etc. |
void |
battleBegin(BattleEvent e)
Handle a battleBegin Event, ie pause Grid, display the Battle system and move the MapObjects between the two. |
void |
battleEnd(BattleEndEvent e)
Handle a battleEnd Event, ie unpause Grid, display the Grid system, destroy Battle system and move the MapObjects between the two. |
void |
gameOver(GameOverEvent e)
Handle a GameOver Event, ie display the Game Over splash and offer the player the option to rebegin. |
void |
init()
Starts the game displaying the default Splash Screen to the user. |
void |
initGrid()
Get the Grid ready to be redisplayed after it was removed, ie add the Monsters. |
void |
loadPlayerFile(java.lang.String file)
Handle the loading of a Player file. |
void |
paint(java.awt.Graphics g)
Draw the Components |
void |
redirectFired(RedirectEvent e)
Handle a redirect event, ie load the new map specified in the RedirectEvent. |
void |
saveGame(SaveEvent e)
Handle a SaveGame Event, ie take the Player specified in SaveEvent and pass it to PlayerSaver then place this text in a TextArea for the user to save it. |
void |
setUpImages()
Load all the required Images and instantiate the classes that depend on them. |
void |
shopEnd(ShopEndEvent e)
Handle a shopEnd Event, ie display the Shop, and move Player between the two |
| Methods inherited from class java.applet.Applet |
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
| Methods inherited from class java.awt.Panel |
addNotify |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Game()
| Method Detail |
public void init()
init in class java.applet.Appletpublic void battleBegin(BattleEvent e)
battleBegin in interface BattleListenere - the BattleEventMapObject,
Grid,
Battle,
Player,
People,
Monsterpublic void battleEnd(BattleEndEvent e)
battleEnd in interface BattleEndListenere - the BattleEndEventMapObject,
Grid,
Battle,
Player,
People,
Monsterpublic void shopEnd(ShopEndEvent e)
shopEnd in interface ShopEndListenere - the ShopEndEventMapObject,
Grid,
Battle,
Player,
People,
Monsterpublic void redirectFired(RedirectEvent e)
redirectFired in interface RedirectListenere - the RedirectEventMapObject,
Grid,
RedirectEvent,
MapLoaderpublic void gameOver(GameOverEvent e)
gameOver in interface GameOverListenere - the GameOverEventMapObject,
Grid,
Battle,
Player,
People,
Monsterpublic void saveGame(SaveEvent e)
saveGame in interface SaveListenere - the SaveEventMapObject,
PlayerSaver,
SaveEvent,
Player,
People,
Monsterpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenere - the ActionEventpublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerpublic void setUpImages()
public void initGrid()
public void loadPlayerFile(java.lang.String file)
Player,
PlayerLoader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||