|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--MapObject | +--People | +--Player
Class to define a Player, carries Monsters, Items and Badges.
People
,
Serialized FormField Summary | |
protected static java.awt.Image |
bimg
The four Images to paint corresponding to the four directions |
protected static java.awt.Image |
img
The four Images to paint corresponding to the four directions |
protected static java.awt.Image |
limg
The four Images to paint corresponding to the four directions |
protected static java.awt.Image |
rimg
The four Images to paint corresponding to the four directions |
Fields inherited from class People |
activeMon, battling, beaten, behind, dir, dlg, hmon, items, MAXMON, mon, money, name |
Fields inherited from class MapObject |
BUILDING, enterable, FLOOR, GRASS, MONSTER, PERSON, PLAYER, REDIRECT, ROCK, TRAINER, type, WALL |
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 | |
Player()
Construct a default Player, Name of Player1 No Money No Monsters No Items No Badges Standing on Grass Facing up |
|
Player(int dir)
Construct a default Player, Name of Player1 No Money No Monsters No Items No Badges Standing on Grass Facing dir |
|
Player(MapObject behind)
Construct a default Player, Name of Player1 No Money No Monsters No Items No Badges Standing on MapObject specified Facing up |
|
Player(MapObject behind,
int dir)
Construct a default Player, Name of Player1 No Money No Monsters No Items No Badges Standing on the MapObject specifid Facing the direction specified |
|
Player(java.lang.String name)
Construct a Player, Name as specified No Money No Monsters No Items No Badges Standing on Grass Facing up |
|
Player(java.lang.String name,
MapObject behind,
int dir)
Construct a default Player, Name as specified No Money No Monsters No Items No Badges Standing on as specified Facing as specified |
Method Summary | |
void |
addBadge(java.lang.String badge)
Adds the badge to the Player. |
int |
getBadgeCount()
Gets the number of Badges acquired. |
MapObject |
getClone()
Returns a default Player as a MapObject |
boolean |
hasBadge(java.lang.String badge)
Determines if the Player has the badge already. |
void |
paint(java.awt.Graphics g)
Draws the Player using the Images passed into setImage. |
void |
setImage(java.awt.Image[] img)
Sets the Image for this. |
Methods inherited from class People |
addItem, addMonster, addMonsterHome, battle, beat, getActiveMonster, getBehind, getDialogue, getDirection, getItem, getItemCount, getItems, getMoney, getMonster, getMonsterAtHome, getMonsterAttacks, getMonsters, getName, getNumberOfMonsters, getNumberOfMonstersAtHome, healAllMonsters, isBattling, isBeaten, isEnterable, setActiveMonster, setBehind, setDialogue, setDirection, setMoney, setName, stopBattle, switchMonster, useItem |
Methods inherited from class MapObject |
canBeEntered, getType |
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, 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, processEvent, 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, 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 |
Field Detail |
protected static java.awt.Image img
protected static java.awt.Image bimg
protected static java.awt.Image limg
protected static java.awt.Image rimg
Constructor Detail |
public Player()
Item
,
Monster
public Player(int dir)
dir
- the direction to face, specified in GridItem
,
Monster
,
Grid
public Player(MapObject behind)
behind
- the MapObjct to be standing onItem
,
Monster
public Player(MapObject behind, int dir)
behind
- the MapObject to stand ondir
- the direction to face as specified in GridItem
,
Monster
,
Grid
public Player(java.lang.String name)
name
- the name of this Player, non nullItem
,
Monster
public Player(java.lang.String name, MapObject behind, int dir)
name
- the Name of thisbehind
- the MapObject standing ondir
- the Direction facing as specified in GridItem
,
Monster
,
Grid
Method Detail |
public void setImage(java.awt.Image[] img)
setImage
in class MapObject
img
- the array of Image to use, needs be length 4.public boolean hasBadge(java.lang.String badge)
Trainer
public void addBadge(java.lang.String badge)
badge
- the name of the Badge to addTrainer
public int getBadgeCount()
public MapObject getClone()
getClone
in class MapObject
MapObject
public void paint(java.awt.Graphics g)
paint
in class java.awt.Component
g
- the Graphics
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |