|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pluginSDK.Entity | +--pluginSDK.Boids
Titre : The Wondrous Farm Description : La classe de base des plugins de Bestioles/Boids Copyright : Copyright (c) 2002 Société : Maitrise d'Info
Field Summary | |
protected double |
acceleration
|
private Behaviours |
b
|
protected double |
heading
|
private ArrayList |
listB
|
private String |
name
|
private int |
nbKill
|
protected double |
speed
|
private int |
type
|
protected double |
viewAngle
|
private int |
worldH
|
private int |
worldW
|
Fields inherited from class pluginSDK.Entity |
h, IS_BEHAVIOUR, IS_BOID, IS_MOTHER, IS_OBSTACLE, isLeader, isSelected, myColor, myWorld, path, w, x, y |
Constructor Summary | |
Boids()
|
|
Boids(int X,
int Y,
double spd,
double hdg,
double accel,
double va,
String nm,
ArrayList f,
int w,
int h)
|
Method Summary | |
void |
addBehaviour(Behaviours b)
Rajoute un cmoportement au Boid |
boolean |
canSee(Entity p)
Renvoie vrai si on peut voir l'entité (boid ou obstacle) |
void |
changeDir(double hdg)
modifier le cap du boid |
double |
directionVersPoint(int bx,
int by)
Renvoie la direction de ce Boid par rapport à un point |
void |
doYourStuff(Flock f)
Fait agir le Boid en fonction des comportements dans le monde auquel il appartient. Tous ses comportements sont appliqués jusqu'à ce qu'il y en ait un qui modifie sont état. |
abstract void |
drawEntity(Graphics g)
Dessine le Boid. |
void |
extraStuff()
Des actions supplémentaire (qd le Boid meure, tue qq'un, ...) Cette méthode est optionnelle. |
double |
getAccel()
|
ArrayList |
getBehaviours()
Renvoie les comportements de ce Boid. |
double |
getHeading()
Renvoie le cap du Boid |
abstract String |
getKind()
Renvoie le type du Boid |
String |
getName()
|
int |
getNbKill()
Renvoie le nombre de victimes du Boid. |
double |
getSpeed()
|
int |
getType()
Renvoie le type du Boid (@see pluginSDK.Plugin) |
double |
getViewAngle()
Renvoie l'angle du champ de vision du Boid |
int |
getWorldHeigth()
|
int |
getWorldWidth()
|
void |
incNbKill()
Augmente le nombre de victimes du Boid de 1 |
void |
move()
Faire avancer le Boid. |
void |
move(double accel)
Faire avancer le Boid encore plus vite |
void |
setAccel(double a)
|
void |
setHeading(double hdg)
idem |
void |
setName(String n)
|
void |
setSpeed(double s)
|
void |
setViewAngle(double a)
Modifie le champ de vision du Boid |
void |
setWorldHeigth(int h)
|
void |
setWorldWidth(int w)
|
Methods inherited from class pluginSDK.Entity |
computeTargetHeading, directionDepuisUnPoint, distanceDepuisUnPoint, getBehaviour, getHeight, getPath, getPosX, getPosY, getSelected, getWidth, getWorld, isLeader, isLeader, seekNearest, seekNearest, setHeight, setMyColor, setPath, setPosX, setPosY, setSelected, setWidth, setWorld, toString, whatIsMyColor |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected double speed
protected double heading
protected double acceleration
protected double viewAngle
private String name
private int type
private Behaviours b
private ArrayList listB
private int nbKill
private int worldW
private int worldH
Constructor Detail |
public Boids()
public Boids(int X, int Y, double spd, double hdg, double accel, double va, String nm, ArrayList f, int w, int h)
X:
- la coordonnée horizontale du BoidY:
- la coordonnée verticale du Boidspd:
- la vitesse du Boidhdg:
- son cap en radian, compris entre 0 et 2*Piaccel:
- son accélérationva:
- son champ de vision en radian, compris entre 0 et 2*Pimn:
- le nom du Boid (Toto, Lady Die, Prince Charles, ...)f:
- les Bestioles qui gravitent autourw:
- la largeur du Boidh:
- sa hauteur.Method Detail |
public int getWorldWidth()
public int getWorldHeigth()
public void setWorldWidth(int w)
public void setWorldHeigth(int h)
public int getType()
getType
in class Entity
pluginSDK.Plugin
public boolean canSee(Entity p)
p:
- l'entité que l'on pourrait voirtrue
si on la voit, false
sinonpublic void changeDir(double hdg)
hdg:
- le nouveau cap en radian, entre 0 et 2*Pipublic void setHeading(double hdg)
public double getHeading()
public void move()
public void move(double accel)
public double getSpeed()
public void setSpeed(double s)
public double getAccel()
public void setAccel(double a)
public double getViewAngle()
public void setViewAngle(double a)
a:
- l'angle en radians entre 0 et 2*Pipublic abstract String getKind()
getKind
in class Entity
public String getName()
public void setName(String n)
public int getNbKill()
public void incNbKill()
public void addBehaviour(Behaviours b)
b:
- le nouveau comportementBehaviours
public ArrayList getBehaviours()
public void doYourStuff(Flock f)
f:
- le monde du Boidpublic double directionVersPoint(int bx, int by)
bx:
- l'abscisse du pointby:
- l'ordonnée du pointpublic void extraStuff()
public abstract void drawEntity(Graphics g)
drawEntity
in class Entity
Graphics
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |