|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.nak.cleaning.object.Element
org.nak.cleaning.VirtualRobot
public class VirtualRobot
Robot in the simulator
Nested Class Summary | |
---|---|
class |
VirtualRobot.BatteryEmptyException
|
class |
VirtualRobot.DustOverloadedException
|
Field Summary | |
---|---|
static int |
_MAX_BATTERY_
|
static int |
_MAX_LOAD_AMOUNT_
|
boolean |
isBatteryChecked
|
int |
visibleBattery
|
Fields inherited from class org.nak.cleaning.object.Element |
---|
appearance, isAbleToSweep, isAbleToWipe, isLiftable, type, volume |
Constructor Summary | |
---|---|
VirtualRobot(Simulator sim)
|
Method Summary | |
---|---|
boolean |
chargeBattery()
Charges the battery. |
void |
checkBatteryWithInterval()
Gets the current battery level. |
java.awt.Point |
find(java.lang.String elemType)
Robot finds the nearest object which type is specified as an argument. |
int |
getBattery()
Gets the current battery level. |
int |
getLoadAmount()
Gets the current load amount of the robot. |
boolean |
isContainedInMap(java.awt.Point p)
Checks whether the specified point is in the map. |
boolean |
isFinished()
Returns whether dust items remain in the field. |
int |
moveNext(Direction d)
Moves to next point (This action consumes power.) |
boolean |
pickUp()
Robot picks up the object at the current place for cleaning |
boolean |
sweep()
Robot sweeps at the current place. |
boolean |
unloadDust()
Unloads dust items into the dust bin |
boolean |
wipe()
Robot wipes at the current place for cleaning. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int _MAX_BATTERY_
public static final int _MAX_LOAD_AMOUNT_
public int visibleBattery
public boolean isBatteryChecked
Constructor Detail |
---|
public VirtualRobot(Simulator sim)
Method Detail |
---|
public boolean isContainedInMap(java.awt.Point p)
p
- Point
public boolean sweep() throws VirtualRobot.BatteryEmptyException, VirtualRobot.DustOverloadedException
VirtualRobot.BatteryEmptyException
VirtualRobot.DustOverloadedException
public boolean pickUp() throws VirtualRobot.BatteryEmptyException, VirtualRobot.DustOverloadedException
VirtualRobot.BatteryEmptyException
VirtualRobot.DustOverloadedException
public boolean wipe() throws VirtualRobot.BatteryEmptyException, VirtualRobot.DustOverloadedException
VirtualRobot.BatteryEmptyException
VirtualRobot.DustOverloadedException
public boolean chargeBattery()
public int moveNext(Direction d) throws VirtualRobot.BatteryEmptyException
d
- Direction that the robot should move
VirtualRobot.BatteryEmptyException
public java.awt.Point find(java.lang.String elemType) throws VirtualRobot.BatteryEmptyException
elemType
- object type
VirtualRobot.BatteryEmptyException
public boolean isFinished() throws VirtualRobot.BatteryEmptyException
VirtualRobot.BatteryEmptyException
public boolean unloadDust()
public int getBattery()
public void checkBatteryWithInterval()
public int getLoadAmount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |