|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSEdit.SElement
SEdit.SNode
warbot.kernel.Entity
warbot.kernel.MovableEntity
warbot.kernel.BasicBody
public abstract class BasicBody
The abstract body class. All brain are linked to a subclass of it
Field Summary | |
---|---|
static java.lang.String[] |
ACTIONS
|
static int |
BAG_CAPACITY
|
protected java.lang.String |
behaviorFileName
|
protected java.lang.String |
brainClass
|
static int |
DISTANCE_TO_EAT
|
static int |
DISTANCE_TO_TAKE
|
protected static int |
DROP
|
protected static int |
DROPALL
|
protected static int |
EAT
|
protected int |
maximumEnergy
|
protected static int |
TAKE
|
Fields inherited from class warbot.kernel.MovableEntity |
---|
MOVE |
Fields inherited from class warbot.kernel.Entity |
---|
action, actionIn, detectingRange, displaySize, energy, initialEnergy, NULL, radius, showDetect, showEnergyLevel, speed, x, xdisplay, y, ydisplay |
Fields inherited from class SEdit.SElement |
---|
comment, descriptor, element, id, label, persistent, structure |
Method Summary | |
---|---|
void |
buildRocket()
try to do the action of building a rocket for future launch |
void |
createAgent(java.lang.String type)
|
void |
createDefaultImage()
|
void |
delete()
|
void |
die()
suicide |
void |
drop(int index)
try to put something out of the robot's bag. you can do this action only one time per turn (when the robot is actived), so it is useless to call it several time in the doIt |
void |
dropAll()
try to put everything out of the robot's bag. you can do this action only one time per turn (when the robot is actived), so it is useless to call it several time in the doIt |
void |
eat(Food f)
|
void |
edit()
|
int |
getBagCapacity()
return the capacity of the robot's bag. |
java.lang.String |
getBehaviorFileName()
Return the behavior file name attached to the brain class used for scripting. |
java.lang.String |
getBrainClass()
Get the brain class name of an entity which generally derives from AbstractAgent. |
double |
getCoveredDistance()
returns the distance covered during the last time unit. |
int |
getEnergy()
return the current energy of the robot |
double |
getHeading()
get the robot's current heading |
int |
getMaximumEnergy()
|
Percept[] |
getPercepts()
return all the percepts avaible within the detecetion range. you have to use the getPerceptType method of an object Percept to know the kind (class) of one percept |
int |
getRadius()
|
int |
getResourceLevel()
|
int |
getRocketNb()
|
boolean |
getShot()
|
java.lang.String |
getTeam()
return the current team as a String Object |
java.lang.String |
getUserMessage()
|
protected void |
increaseEnergyLevel(int v)
|
void |
init()
Initialization method called at the end of the creation of an element. |
Percept[] |
inMyBag()
|
boolean |
isMyBagEmpty()
return true if the robot's bag if empty. |
boolean |
isMyBagFull()
return true if the robot's bag if full. |
boolean |
isShowMessages()
|
boolean |
isShowUserMessage()
|
void |
launchRocket(double direction)
try to do the action of launching a rocket in the direction wanted to do this kind of action you have to be rocket launcher, this is done by play the role of rocket launcher. |
void |
makeBrain(java.lang.String className,
java.lang.String name,
boolean gui,
java.lang.String behaviorFileName)
Creates the brain and launches if it is an agent. |
Percept |
makePercept(double dx,
double dy,
double d,
double a)
|
void |
move()
try to do the action of move in the world you can do this action only one time per turn (when the robot is actived), so it is useless to call it several time in the doIt |
boolean |
moving()
|
int |
nbOfObjectsInMyBag()
return the current nb of objects in the robot's bag. |
void |
setBehaviorFileName(java.lang.String s)
Set the behavior file name attached to the brain class used for scripting the behavior. |
void |
setBrainClass(java.lang.String s)
set the brain class name of an entity. |
void |
setHeading(double direction)
set the robot heading to the direction of value |
protected void |
setPercepts(Percept[] plst)
|
void |
setShowMessages(boolean b)
|
void |
setShowUserMessage(boolean b)
|
void |
setUserMessage(java.lang.String s)
|
void |
take(Transportable p)
try to put something in the robot's bag. you can do this action only one time per turn (when the robot is actived), so it is useless to call it several time in the doIt |
void |
toggleShowMessages()
|
void |
toggleShowUserMessage()
|
protected void |
tryEat()
|
Methods inherited from class warbot.kernel.MovableEntity |
---|
getCoveredDistance, getHeading, makePercept, moving, setHeading, tryMove |
Methods inherited from class warbot.kernel.Entity |
---|
addInArrow, addOutArrow, decreaseEnergyLevel, distanceFrom, dropEntity, getDetectingRange, getEnergy, getEnvironmentAgent, getInArrows, getName, getOutArrows, getRadius, getShot, getShowDetect, getShowEnergyLevel, getSpeed, getTeam, getX, getY, isConnectable, setDetectingRange, setEnergy, setEnvironmentAgent, setName, setRadius, setShowDetect, setShowEnergyLevel, setSpeed, setTeam, setX, setY, toggleShowDetect, toggleShowEnergyLevel, 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 int DISTANCE_TO_TAKE
public static final int DISTANCE_TO_EAT
protected int maximumEnergy
protected static final int EAT
protected static final int TAKE
protected static final int DROP
protected static final int DROPALL
public static final java.lang.String[] ACTIONS
public static final int BAG_CAPACITY
protected java.lang.String brainClass
protected java.lang.String behaviorFileName
Method Detail |
---|
public Percept makePercept(double dx, double dy, double d, double a)
public void createDefaultImage()
public void setShowMessages(boolean b)
public boolean isShowMessages()
public void toggleShowMessages()
public void setBrainClass(java.lang.String s)
public java.lang.String getBrainClass()
public void setBehaviorFileName(java.lang.String s)
public java.lang.String getBehaviorFileName()
public void makeBrain(java.lang.String className, java.lang.String name, boolean gui, java.lang.String behaviorFileName)
public void init()
SElement
init
in class Entity
public void setShowUserMessage(boolean b)
public boolean isShowUserMessage()
public void toggleShowUserMessage()
public void setUserMessage(java.lang.String s)
public java.lang.String getUserMessage()
public final void delete()
delete
in class Entity
public void edit()
public final void die()
protected void setPercepts(Percept[] plst)
public Percept[] getPercepts()
public void move()
public void eat(Food f)
public int getMaximumEnergy()
public int getResourceLevel()
protected void tryEat()
protected void increaseEnergyLevel(int v)
increaseEnergyLevel
in class Entity
public void take(Transportable p)
public Percept[] inMyBag()
public boolean isMyBagEmpty()
public boolean isMyBagFull()
public int getBagCapacity()
public int nbOfObjectsInMyBag()
public void drop(int index)
public void dropAll()
public void launchRocket(double direction)
public void buildRocket()
public int getRocketNb()
public void createAgent(java.lang.String type)
public void setHeading(double direction)
public double getHeading()
public java.lang.String getTeam()
public double getCoveredDistance()
public int getEnergy()
public boolean getShot()
public boolean moving()
public int getRadius()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |