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
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
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
Entity
public Entity()
Entity
public Entity(int X,
int Y,
ArrayList f)
- Parameters:
X:
- abscisse de l'entité dans le mondeY:
- son ordonnéef:
- ses copines.
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)