Class MapObject

java.lang.Object
  |
  +--java.awt.Component
        |
        +--MapObject
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
Building, Floor, Grass, Monster, People, Redirect, Rock, Wall

public abstract class MapObject
extends java.awt.Component

Super class of all Objects on the Grid

See Also:
Grid, Serialized Form

Field Summary
static int BUILDING
          Type Building
protected  boolean enterable
          true iff can be entered, ie Grass, Floor
static int FLOOR
          Type Floor
static int GRASS
          Type Grass
static int MONSTER
          Type Monster
static int PERSON
          Type Person
static int PLAYER
          Type Player
static int REDIRECT
          Type Redirect
static int ROCK
          Type Rock
static int TRAINER
          Type Trainer
protected  int type
          The type of this
static int WALL
          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
MapObject()
           
 
Method Summary
 boolean canBeEntered()
          return true if can be entered, ie Grass, Floor.
abstract  MapObject getClone()
          return a clone of this
 int getType()
          Gets the type associated with this.
abstract  void setImage(java.awt.Image[] img)
          Sets the image to display.
 
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, 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, 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
 

Field Detail

GRASS

public static final int GRASS
Type Grass

See Also:
Constant Field Values

PERSON

public static final int PERSON
Type Person

See Also:
Constant Field Values

PLAYER

public static final int PLAYER
Type Player

See Also:
Constant Field Values

ROCK

public static final int ROCK
Type Rock

See Also:
Constant Field Values

MONSTER

public static final int MONSTER
Type Monster

See Also:
Constant Field Values

BUILDING

public static final int BUILDING
Type Building

See Also:
Constant Field Values

FLOOR

public static final int FLOOR
Type Floor

See Also:
Constant Field Values

REDIRECT

public static final int REDIRECT
Type Redirect

See Also:
Constant Field Values

WALL

public static final int WALL
Type Wall

See Also:
Constant Field Values

TRAINER

public static final int TRAINER
Type Trainer

See Also:
Constant Field Values

enterable

protected boolean enterable
true iff can be entered, ie Grass, Floor


type

protected int type
The type of this

Constructor Detail

MapObject

public MapObject()
Method Detail

getClone

public abstract MapObject getClone()
return a clone of this

Returns:
a clone of this

setImage

public abstract void setImage(java.awt.Image[] img)
Sets the image to display. Needs be called before paint

Parameters:
img - the array of images to use

canBeEntered

public boolean canBeEntered()
return true if can be entered, ie Grass, Floor.

Returns:
true if can be entered, ie Grass, Floor.

getType

public int getType()
Gets the type associated with this.

Returns:
the type associated with this.