org.simbrain.world.odorworld
Class AbstractEntity

java.lang.Object
  extended by org.simbrain.world.odorworld.AbstractEntity
Direct Known Subclasses:
OdorWorldEntity, Wall

public abstract class AbstractEntity
extends Object

AbstractEntity is an abstract class providing a basic structure for all items in the world.

Author:
RJB

Constructor Summary
AbstractEntity()
           
 
Method Summary
abstract  int getBites()
           
abstract  int getBitesToDie()
           
abstract  boolean getEdible()
           
abstract  int getHeight()
           
abstract  Point getLocation()
           
abstract  OdorWorld getParent()
           
abstract  Rectangle getRectangle()
          Returns a Rectangle describing the location of the Entity (For Calculating Collisions).
abstract  Rectangle getRectangle(Point p)
           
abstract  double getResurrectionProb()
           
abstract  Stimulus getStimulus()
           
abstract  int getWidth()
           
abstract  int getX()
           
abstract  int getY()
           
abstract  void paintThis(Graphics g)
          Causes the item to paint itself to the world.
abstract  void setBites(int bites)
           
abstract  void setEdible(boolean edible)
           
abstract  void setParent(OdorWorld world)
           
abstract  void setResurrectionProb(double bites)
           
abstract  void setX(int x)
           
abstract  void setY(int y)
           
abstract  void terminate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEntity

public AbstractEntity()
Method Detail

getX

public abstract int getX()
Returns:
the x position of the entity

getY

public abstract int getY()
Returns:
the y position

setX

public abstract void setX(int x)
Parameters:
x - the x to set

setY

public abstract void setY(int y)
Parameters:
y - the y to set

getWidth

public abstract int getWidth()
Returns:
the width

getHeight

public abstract int getHeight()
Returns:
the height

getEdible

public abstract boolean getEdible()
Returns:
the edibility

setEdible

public abstract void setEdible(boolean edible)
Parameters:
edible - the boolean value for edibility

getBitesToDie

public abstract int getBitesToDie()
Returns:
the number of bites to die

getBites

public abstract int getBites()
Returns:
the number of bites

setBites

public abstract void setBites(int bites)
Parameters:
bites - the bites to set

getResurrectionProb

public abstract double getResurrectionProb()
Returns:
the probability of resurrection

setResurrectionProb

public abstract void setResurrectionProb(double bites)
Parameters:
bites - the resurrection prob to set

terminate

public abstract void terminate()

getRectangle

public abstract Rectangle getRectangle()
Returns a Rectangle describing the location of the Entity (For Calculating Collisions).

Returns:
Rectangle that represents the current boundaries of this entity

getRectangle

public abstract Rectangle getRectangle(Point p)
Parameters:
p - the point around which to build the testing bounds
Returns:
the testing bounds

getParent

public abstract OdorWorld getParent()
Returns:
the parent OdorWorld

getStimulus

public abstract Stimulus getStimulus()
Returns:
the stimulus produced by this entity

setParent

public abstract void setParent(OdorWorld world)
Parameters:
world - the parent OdorWorld to set

paintThis

public abstract void paintThis(Graphics g)
Causes the item to paint itself to the world.

Parameters:
g - is the graphics item for the panel

getLocation

public abstract Point getLocation()
Returns:
the location of this entity