|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--MapObject | +--People
Class to define People, the superclass of Person, Player and Trainer. Carry Items Monsters and Monsters at Home
Monster
,
Item
,
Person
,
Player
,
Trainer
,
Serialized FormField Summary | |
protected int |
activeMon
The index of the active Monster |
protected boolean |
battling
True if in a battle, with Player or Person |
protected boolean |
beaten
True if has beed beaten by the Player |
protected static MapObject |
behind
The MapObject to paint this on top of |
protected int |
dir
The direction facing as specified in Grid |
protected java.lang.String |
dlg
The dialogue to present when in Battle |
protected java.util.Vector |
hmon
The Monsters caught, and not able to be used, ie in the Pepole's home collection |
protected java.util.Vector |
items
The Items bought. |
protected int |
MAXMON
The Maximum number of Monsters to cary |
protected java.util.Vector |
mon
The Monsters caught, and able to be used, ie in the Pepole's hand |
protected int |
money
The amount of money carrying |
protected java.lang.String |
name
The name of this |
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 | |
People()
|
Method Summary | |
void |
addItem(Item i)
Adds the Item specified to this. |
boolean |
addMonster(Monster p)
Adds a Monster to this, either to the hand or to home if the hand has more than this.MAXMON |
void |
addMonsterHome(Monster p)
Adds a Monster to the Home collection |
void |
battle()
Begins a battle with this, sets battle to true. |
void |
beat()
Defeat this, ie sets beaten to true. |
int |
getActiveMonster()
Gets the index of the Active Monster. |
MapObject |
getBehind()
Gets the MapObject standing on |
java.lang.String |
getDialogue()
Gets the dialogue associated with this |
int |
getDirection()
Gets the direction facing |
Item |
getItem(java.lang.String name)
Gets the Item corresponding to the name specified. |
int |
getItemCount(java.lang.String name)
Gets the number of Item this has. |
java.lang.String[] |
getItems()
Gets an array of Strings of the Item that the Player is currently carrying |
int |
getMoney()
Gets the amount of Money carried. |
Monster |
getMonster(int i)
Gets the Monster from the hand at the specified index, ignoring Monsters that have no HP. |
Monster |
getMonsterAtHome(int i)
Gets the Monster from home at the specified index, ignoring Monsters that have no HP. |
java.lang.String[] |
getMonsterAttacks(int p)
Gets an array of String for the Attacks available for the Monster at index p, ignoring the Monsters with no HP. |
java.lang.String[] |
getMonsters()
Gets an array of Strings of the Monsters that the Player is currently carrying, ignoring those with no HP. |
java.lang.String |
getName()
Gets the name of this. |
int |
getNumberOfMonsters()
Gets the number of Monsters in the hand that do not have 0 hp. |
int |
getNumberOfMonstersAtHome()
Gets the number of Monsters at home that do not have 0 hp. |
void |
healAllMonsters()
Heals all Monster to full HP, Attack Points, and Defense Points |
boolean |
isBattling()
Gets if this is in a Battle |
boolean |
isBeaten()
Determine if this has been beaten. |
boolean |
isEnterable()
Returns false, as this cannot be entered |
void |
setActiveMonster(int i)
Sets the ActiveMonster for this. |
void |
setBehind(MapObject beh)
Sets the MapObject to paint behind |
void |
setDialogue(java.lang.String slf)
Sets the dialogue associated with this |
boolean |
setDirection(int direct)
Sets the directio of this as specified in Grid |
void |
setMoney(int mon)
Sets the amount of Money carried. |
void |
setName(java.lang.String name)
Sets the name of this. |
void |
stopBattle()
Ends a battle with this, sets battle to false. |
boolean |
switchMonster(Monster hand,
Monster home)
Switches a Monster from Home collection to the Hand collection. |
void |
useItem(Item it,
Monster m)
Uses the Item specified on the Monster specified |
Methods inherited from class MapObject |
canBeEntered, getClone, getType, setImage |
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, paint, 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 final int MAXMON
protected java.util.Vector mon
protected java.util.Vector hmon
protected java.util.Vector items
protected int activeMon
protected boolean beaten
protected boolean battling
protected int money
protected static MapObject behind
protected int dir
Grid
protected java.lang.String name
protected java.lang.String dlg
Battle
Constructor Detail |
public People()
Method Detail |
public java.lang.String getDialogue()
public void setDialogue(java.lang.String slf)
slf
- the dialogue associated with thispublic boolean isEnterable()
public boolean setDirection(int direct)
direct
- the direction to face
Grid
public int getDirection()
Grid
public void setBehind(MapObject beh)
beh
- the MapObject to paint this overpublic MapObject getBehind()
public void beat()
public boolean isBattling()
Battle
,
PersonAI
public void battle()
public void stopBattle()
public void setMoney(int mon)
mon
- the amount of money carriedpublic int getMoney()
public java.lang.String getName()
getName
in class java.awt.Component
public void setName(java.lang.String name)
setName
in class java.awt.Component
name
- the name of thispublic boolean isBeaten()
public boolean addMonster(Monster p)
p
- the Monster to add
Monster
public void addMonsterHome(Monster p)
Monster
public boolean switchMonster(Monster hand, Monster home)
hand
- the Monster in the hand to send homehome
- the Monster at home to send to the handMonster
public void setActiveMonster(int i)
i
- the new index of the ActiveMonster for this.public int getActiveMonster()
public Monster getMonster(int i)
i
- the index to retrieve the Monster from
public Monster getMonsterAtHome(int i)
i
- the index to retrieve the Monster from
public int getNumberOfMonsters()
public int getNumberOfMonstersAtHome()
public void addItem(Item i)
i
- the Item to addItem
public Item getItem(java.lang.String name)
Item
public void useItem(Item it, Monster m)
it
- the Item to use on the Monsterm
- the Monster to use the Item onMonster
,
Item
public int getItemCount(java.lang.String name)
name
- the name of the Item to get the count of.Item
public void healAllMonsters()
Monster
,
Shop
public java.lang.String[] getMonsterAttacks(int p)
Monster
,
Battle
public java.lang.String[] getMonsters()
Monster
,
Battle
public java.lang.String[] getItems()
Item
,
Battle
,
Shop
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |