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 |
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 |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
c_capacity
private int c_capacity
- The carrying capacity of this robot
money
private int money
- the money
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 robotx
- initial x positiony
- initial y positionccap
- maximum carrying capacitymny
- 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 identifierccap
- the carrying capacitymny
- amount of money
Robot
public Robot()
- Default constructor
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