warbot.kernel
Class RocketLauncher

java.lang.Object
  extended by SEdit.SElement
      extended by SEdit.SNode
          extended by warbot.kernel.Entity
              extended by warbot.kernel.MovableEntity
                  extended by warbot.kernel.BasicBody
                      extended by warbot.kernel.RocketLauncher
All Implemented Interfaces:
java.io.Serializable

public class RocketLauncher
extends BasicBody

See Also:
Serialized Form

Field Summary
protected static int BUILD_ROCKET
           
protected static int maximumRocket
           
protected  int rocketNb
           
protected static int SHOOT
           
 
Fields inherited from class warbot.kernel.BasicBody
ACTIONS, BAG_CAPACITY, behaviorFileName, brainClass, DISTANCE_TO_EAT, DISTANCE_TO_TAKE, DROP, DROPALL, EAT, maximumEnergy, 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
 
Constructor Summary
RocketLauncher()
           
RocketLauncher(WarbotEnvironment env, Brain b, java.lang.String team)
           
 
Method Summary
 void buildRocket()
          try to do the action of building a rocket for future launch
 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 getRadius()
           
 int getRocketNb()
           
 boolean getShot()
           
 java.lang.String getTeam()
          return the current team as a String Object
 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.
 Percept makePercept(double dx, double dy, double d)
           
 boolean moving()
           
 void setHeading(double direction)
          set the robot heading to the direction of value
 
Methods inherited from class warbot.kernel.BasicBody
createAgent, createDefaultImage, delete, die, drop, dropAll, eat, edit, getBagCapacity, getBehaviorFileName, getBrainClass, getMaximumEnergy, getPercepts, getResourceLevel, getUserMessage, increaseEnergyLevel, init, inMyBag, isMyBagEmpty, isMyBagFull, isShowMessages, isShowUserMessage, makeBrain, makePercept, move, nbOfObjectsInMyBag, setBehaviorFileName, setBrainClass, setPercepts, setShowMessages, setShowUserMessage, setUserMessage, take, toggleShowMessages, toggleShowUserMessage, tryEat
 
Methods inherited from class warbot.kernel.MovableEntity
getCoveredDistance, getHeading, 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

maximumRocket

protected static final int maximumRocket
See Also:
Constant Field Values

rocketNb

protected int rocketNb

SHOOT

protected static final int SHOOT
See Also:
Constant Field Values

BUILD_ROCKET

protected static final int BUILD_ROCKET
See Also:
Constant Field Values
Constructor Detail

RocketLauncher

public RocketLauncher(WarbotEnvironment env,
                      Brain b,
                      java.lang.String team)

RocketLauncher

public RocketLauncher()
Method Detail

makePercept

public Percept makePercept(double dx,
                           double dy,
                           double d)
Overrides:
makePercept in class MovableEntity

launchRocket

public 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. As the action move, it is useless to call this method several time in the doIt: at most just one rocket will be launched

Overrides:
launchRocket in class BasicBody

buildRocket

public void buildRocket()
Description copied from class: BasicBody
try to do the action of building a rocket for future launch

Overrides:
buildRocket in class BasicBody

getRocketNb

public int getRocketNb()
Overrides:
getRocketNb in class BasicBody

setHeading

public void setHeading(double direction)
set the robot heading to the direction of value


getHeading

public double getHeading()
get the robot's current heading


getTeam

public java.lang.String getTeam()
return the current team as a String Object


getCoveredDistance

public double getCoveredDistance()
returns the distance covered during the last time unit. This method may be called to sum the path taken by agents.


getEnergy

public int getEnergy()
return the current energy of the robot


getShot

public boolean getShot()

moving

public boolean moving()

getRadius

public int getRadius()


Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.