Class Robot

java.lang.Object
  |
  +--IdentifiedWithPosition
        |
        +--SimpleRobot
              |
              +--Robot

public class Robot
extends SimpleRobot

The robot of the actual player (the program :) )


Field Summary
private  int c_capacity
          The carrying capacity of this robot
private  int money
          the money
 
Fields inherited from class IdentifiedWithPosition
id, x_pos, y_pos
 
Constructor Summary
Robot()
          Default constructor
Robot(int id, int ccap, int mny)
          makes a robot with the given id, carrying capacity and some money.
Robot(int id, int x, int y, int ccap, int mny)
          make a new robot with all the given parameters
 
Method Summary
 int carryingCapacity()
          Returns the carrying capacity of the robot
 void execute(Command cmd)
          executes the given command
 int money()
          returns the money of the robot
 void setCarryingCapacity(int ccap)
          sets the carrying capacity of the robot
 void setMoney(int mny)
          sets the money of the robot
 
Methods inherited from class IdentifiedWithPosition
id, setId, setPos, setX, setY, x, y
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

c_capacity

private int c_capacity
The carrying capacity of this robot

money

private int money
the money
Constructor Detail

Robot

public Robot(int id,
             int x,
             int y,
             int ccap,
             int mny)
make a new robot with all the given parameters
Parameters:
id - the identifier of the robot
x - initial x position
y - initial y position
ccap - maximum carrying capacity
mny - amount of money

Robot

public Robot(int id,
             int ccap,
             int mny)
makes a robot with the given id, carrying capacity and some money.
Parameters:
id - the identifier
ccap - the carrying capacity
mny - amount of money

Robot

public Robot()
Default constructor
Method Detail

setCarryingCapacity

public void setCarryingCapacity(int ccap)
sets the carrying capacity of the robot
Parameters:
ccap - carrying capacity

carryingCapacity

public int carryingCapacity()
Returns the carrying capacity of the robot
Returns:
the carrying capacity

setMoney

public void setMoney(int mny)
sets the money of the robot
Parameters:
mny - the amount of money

money

public int money()
returns the money of the robot
Returns:
the amount of money of the robot

execute

public void execute(Command cmd)
executes the given command
Parameters:
cmd - the command to execute