|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSEdit.SElement
SEdit.SNode
SEdit.Formalisms.World.WorldEntity
SEdit.Formalisms.World.MobileEntity
Field Summary | |
static int |
BOUND
Movement type which supposes that the world is bounded |
static double |
convDegGrad
|
static double |
convGradDeg
|
protected int |
movementType
Current movement type. |
static int |
WRAP
Movement type which supposes that the world is toric |
Fields inherited from class SEdit.Formalisms.World.WorldEntity |
behaviorFileName, brainClass |
Fields inherited from class SEdit.SElement |
comment, descriptor, element, id, label, persistent, structure |
Constructor Summary | |
MobileEntity()
|
Method Summary | |
void |
avoidObstacles(Vector ents)
Avoid obstacles by bouncing on them. |
Vector |
detect()
Returns a vector of all entities detected within the current detecting range. |
void |
directTowards(WorldEntity e)
Heads the body into the direction of an entity e |
int |
getDetectingRange()
Get the current detecting range |
int |
getDirection()
|
int |
getDirectionTo(Point p)
Computes and returns the direction which heads to a position given by a Point p. |
int |
getDirectionTo(WorldEntity e)
Computes and returns the direction which heads to the position of an entity e. |
int |
getDistanceTo(WorldEntity e)
Computes and returns the distance between the mobile entity and an entity e. |
int |
getMaxSpeed()
Returns the maximum speed of a body |
int |
getSpeed()
get the current speed of a body. |
void |
init()
Initialization method called at the end of the creation of an element. |
boolean |
isDetecting()
indicates whether the body detects an entity or not |
boolean |
isTouching(WorldEntity e)
Indicates if this mobile entity touches a world entity |
void |
move()
Moves the body at its speed |
void |
moveTo(WorldEntity e)
Move in the direction of an entity e. |
void |
randomDir()
Gives a random direction to the body. |
void |
randomMove()
moves a body into a random direction. |
void |
setDetecting(boolean b)
Set if the body can detect entities or not |
void |
setDetectingRange(int r)
Set the detecting rang. |
void |
setDirection(int r)
Set the current direction of a body. |
void |
setMaxSpeed(int r)
Set the maximum speed at which a body can move |
void |
setRandomCptMax(int n)
|
void |
setSpeed(int r)
Set the current speed of a body. |
Methods inherited from class SEdit.Formalisms.World.WorldEntity |
addInArrow, addOutArrow, afterDoIt, beforeDoIt, bodyDoIt, delete, doIt, getBehaviorFileName, getBrain, getBrainClass, getDistance, getInArrows, getLocation, getOutArrows, getPosition, isConnectable, makeBrain, selfDelete, setBehaviorFileName, setBrain, setBrainClass, showLine, toString |
Methods inherited from class SEdit.SNode |
activate, deleteInArrow, deleteOutArrow, initGraphics, reInstall |
Methods inherited from class SEdit.SElement |
dump, getComment, getDescriptor, getGObject, getID, getLabel, getStructure, inspect, setComment, setDescriptor, setGObject, setID, setLabel, setStructure |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final double convDegGrad
public static final double convGradDeg
public static int BOUND
public static int WRAP
protected int movementType
Constructor Detail |
public MobileEntity()
Method Detail |
public void setMaxSpeed(int r)
public int getMaxSpeed()
public void setSpeed(int r)
public int getSpeed()
public void setDirection(int r)
public int getDirection()
public void setDetecting(boolean b)
public boolean isDetecting()
public void setDetectingRange(int r)
public int getDetectingRange()
public void init()
SElement
init
in class SElement
public void move()
public void directTowards(WorldEntity e)
public int getDirectionTo(WorldEntity e)
public int getDirectionTo(Point p)
public int getDistanceTo(WorldEntity e)
public void moveTo(WorldEntity e)
public Vector detect()
public void avoidObstacles(Vector ents)
public boolean isTouching(WorldEntity e)
public void randomDir()
public void setRandomCptMax(int n)
public void randomMove()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |