pluginSDK
Class Entity

java.lang.Object
  |
  +--pluginSDK.Entity
All Implemented Interfaces:
Plugin, Serializable
Direct Known Subclasses:
Boids, Obstacle

public abstract class Entity
extends Object
implements Plugin

Title: the Wondrous Farm
Description: La classe correspondant à toutes les entités que l'on trouve dans la simulation, Boids, Obstacles, ...
Copyright: Copyright (c) 2002
Company: minfo

See Also:
Serialized Form

Field Summary
protected  int h
           
static int IS_BEHAVIOUR
           
static int IS_BOID
           
static int IS_MOTHER
           
static int IS_OBSTACLE
           
private  boolean isLeader
           
private  boolean isSelected
           
protected  Color myColor
           
protected  ArrayList myWorld
           
private  String path
           
private  int type
           
protected  int w
           
protected  int x
           
protected  int y
           
 
Constructor Summary
Entity()
           
Entity(int X, int Y, ArrayList f)
           
 
Method Summary
 double computeTargetHeading(int X, int Y)
           
 double directionDepuisUnPoint(int xOrigine, int yOrigine, double axe)
           
 double distanceDepuisUnPoint(int x1, int y1)
           
abstract  void drawEntity(Graphics g)
           
 String getBehaviour()
          Renvoie le type de comportement auquel on a affaire.
 int getHeight()
           
abstract  String getKind()
          Renvoie le type de Boids ou d'obstacles auquels on a affaire.
 String getPath()
           
 int getPosX()
           
 int getPosY()
           
 boolean getSelected()
           
 int getType()
          Renvoie une constante entière qui permet de savoir si on affaire à un Boids, un Obstacle, ...
C'est pour faire un peu plus propre et plus léger que le instanceof
 int getWidth()
           
 ArrayList getWorld()
           
 boolean isLeader()
           
 void isLeader(boolean l)
           
 Entity seekNearest()
           
static Entity seekNearest(Flock f, int x, int y)
           
 void setHeight(int h)
           
 void setMyColor(Color c)
           
 void setPath(String p)
           
 void setPosX(int X)
           
 void setPosY(int Y)
           
 void setSelected(boolean s)
           
 void setWidth(int w)
           
 void setWorld(ArrayList f)
           
 String toString()
           
 Color whatIsMyColor()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

x

protected int x

y

protected int y

w

protected int w

h

protected int h

myWorld

protected ArrayList myWorld

myColor

protected Color myColor

type

private int type

isLeader

private boolean isLeader

isSelected

private boolean isSelected

path

private String path

IS_MOTHER

public static final int IS_MOTHER

IS_BOID

public static final int IS_BOID

IS_OBSTACLE

public static final int IS_OBSTACLE

IS_BEHAVIOUR

public static final int IS_BEHAVIOUR
Constructor Detail

Entity

public Entity()

Entity

public Entity(int X,
              int Y,
              ArrayList f)
Parameters:
X: - abscisse de l'entité dans le monde
Y: - son ordonnée
f: - ses copines.
Method Detail

getType

public int getType()
Description copied from interface: Plugin
Renvoie une constante entière qui permet de savoir si on affaire à un Boids, un Obstacle, ...
C'est pour faire un peu plus propre et plus léger que le instanceof
Specified by:
getType in interface Plugin
Following copied from interface: pluginSDK.Plugin
Returns:
int: le type du Boid

getPosX

public int getPosX()

setPosX

public void setPosX(int X)

getPosY

public int getPosY()

setPosY

public void setPosY(int Y)

setHeight

public void setHeight(int h)

getHeight

public int getHeight()

setWidth

public void setWidth(int w)

getWidth

public int getWidth()

getBehaviour

public String getBehaviour()
Description copied from interface: Plugin
Renvoie le type de comportement auquel on a affaire. En fait on ne s'en set pas.
Specified by:
getBehaviour in interface Plugin
Following copied from interface: pluginSDK.Plugin
Returns:
String: la description du comportement.

whatIsMyColor

public Color whatIsMyColor()

setMyColor

public void setMyColor(Color c)

getWorld

public ArrayList getWorld()

setWorld

public void setWorld(ArrayList f)

isLeader

public boolean isLeader()

isLeader

public void isLeader(boolean l)

getSelected

public boolean getSelected()

setSelected

public void setSelected(boolean s)

setPath

public void setPath(String p)

getPath

public String getPath()

getKind

public abstract String getKind()
Description copied from interface: Plugin
Renvoie le type de Boids ou d'obstacles auquels on a affaire. En fait on ne s'en set pas.
Specified by:
getKind in interface Plugin
Following copied from interface: pluginSDK.Plugin
Returns:
String: la description du type de Boids ou d'obstacles.

toString

public String toString()
Specified by:
toString in interface Plugin
Overrides:
toString in class Object
Following copied from interface: pluginSDK.Plugin
Returns:
String: le nom abrégé (sans le plugins) du plugin.

drawEntity

public abstract void drawEntity(Graphics g)

computeTargetHeading

public double computeTargetHeading(int X,
                                   int Y)

directionDepuisUnPoint

public double directionDepuisUnPoint(int xOrigine,
                                     int yOrigine,
                                     double axe)

distanceDepuisUnPoint

public double distanceDepuisUnPoint(int x1,
                                    int y1)

seekNearest

public Entity seekNearest()

seekNearest

public static Entity seekNearest(Flock f,
                                 int x,
                                 int y)