|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--Battle
Defines the battling arena. Displays the Player and opponents health, Handles the use of Items, Switches the Active Monster, and if opponent is a Trainer gives the Player his Badge if Player wins. The Player recieves half of the money carried by the opponent and recieves experience propertional to the level of the opponent's Monster(s). Displays the dialogue associated with the opponent after the conclusion of the battle if Player wins, else Fires a GameOverEvent.
Monster
,
MapObject
,
People
,
Person
,
Player
,
BattleEndEvent
,
BattleEndListener
,
GameOverEvent
,
GameOverListener
,
ImageMap
,
Item
,
Serialized FormField 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 | |
Battle(Player p,
MapObject opp)
Construct a Battle between Player and the MapObject. |
|
Battle(Player p,
MapObject opp,
ImageMap[] monsterImageMap)
Construct a Battle between Player and the MapObject using images in the ImageMap. |
Method Summary | |
void |
addBattleEndListener(BattleEndListener bl)
Adds a BattleEndListener to be informed. |
void |
addGameOverListener(GameOverListener bl)
Adds a GameOverListener to be informed. |
void |
paint(java.awt.Graphics g)
Draws the Battle screen system with Monsters, Health bars, and Menus |
void |
processEvent(java.awt.AWTEvent e)
Process the events passed to this. |
void |
removeBattleListener(BattleEndListener bl)
Removes a BattleEndListener to not be informed anymore. |
void |
removeGameOverListener(GameOverListener bl)
Removes a GameOverListener to stop being informed. |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Battle(Player p, MapObject opp)
p
- the Player to battle withopp
- the opponent of the PlayerPlayer
,
MapObject
,
Trainer
,
People
,
Person
public Battle(Player p, MapObject opp, ImageMap[] monsterImageMap)
p
- the Player to battle withopp
- the opponent of the PlayermonsterImageMap
- the Images (Front and Back) of all the Monsters usedPlayer
,
MapObject
,
Trainer
,
People
,
Person
,
ImageMap
Method Detail |
public void processEvent(java.awt.AWTEvent e)
processEvent
in class java.awt.Component
e
- the AWTEvent to handlepublic void paint(java.awt.Graphics g)
paint
in class java.awt.Component
g
- the Graphicspublic void addBattleEndListener(BattleEndListener bl)
bl
- the Class to be informed of BattleEndEvents.BattleEndEvent
,
BattleEndListener
public void removeBattleListener(BattleEndListener bl)
bl
- the Class to stop being informed of BattleEndEvents.BattleEndEvent
,
BattleEndListener
public void addGameOverListener(GameOverListener bl)
bl
- the Class to be informed of GameOverEvents.GameOverEvent
,
GameOverListener
public void removeGameOverListener(GameOverListener bl)
bl
- the Class to stop being informed of GameOverEvents.GameOverEvent
,
GameOverListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |