public class HeadlessKarel extends Object
CENTER
Constructor and Description |
---|
HeadlessKarel() |
Modifier and Type | Method and Description |
---|---|
boolean |
beepersInBag() |
boolean |
beepersPresent() |
protected void |
checkWorld(String caller) |
void |
exit()
Exits the program.
|
boolean |
facingEast() |
boolean |
facingNorth() |
boolean |
facingSouth() |
boolean |
facingWest() |
boolean |
frontIsBlocked() |
boolean |
frontIsClear() |
int |
getBeepersInBag() |
int |
getDirection() |
Point |
getLocation() |
Set<Point> |
getLocationsVisited() |
protected String |
getSaveFile() |
String |
getTitle() |
KarelWorld |
getWorld() |
protected String |
getWorldFile() |
boolean |
hasVisited(int x,
int y) |
boolean |
hasVisited(Point pt) |
void |
init()
Initializes Karel.
|
boolean |
leftIsBlocked() |
boolean |
leftIsClear() |
static void |
main(String[] args) |
void |
move() |
boolean |
noBeepersInBag() |
boolean |
noBeepersPresent() |
boolean |
notFacingEast() |
boolean |
notFacingNorth() |
boolean |
notFacingSouth() |
boolean |
notFacingWest() |
void |
pause(double ms) |
void |
pickBeeper() |
void |
print(Object value) |
void |
print(String value) |
void |
printf(String format,
Object... args) |
void |
println() |
void |
println(Object value) |
void |
println(String value) |
void |
putBeeper() |
boolean |
rightIsBlocked() |
boolean |
rightIsClear() |
void |
run() |
void |
setBeepersInBag(int nBeepers) |
void |
setDirection(int dir) |
void |
setDisplayOneFlag(boolean flag) |
static void |
setExitEnabled(boolean enabled) |
void |
setLocation(int x,
int y) |
void |
setLocation(Point pt) |
void |
setParameterTable(Map<String,String> table) |
void |
setSaveFile(String filename) |
void |
setStartupObject(Object obj) |
void |
setTitle(String title) |
void |
setTrackLocationsVisited(boolean track) |
void |
setWorld(KarelWorld world) |
void |
setWorldFile(String filename) |
void |
start() |
void |
start(String[] args)
Starts a
KarelProgram containing this Karel instance,
passing it the specified arguments. |
void |
turnLeft() |
public final void exit()
protected final String getSaveFile()
protected final String getWorldFile()
public final boolean hasVisited(int x, int y)
public final boolean hasVisited(Point pt)
public final void init()
public final void move()
move
in interface KarelInterface
public void run()
run
in interface ProgramInterface
run
in interface Runnable
run
in interface KarelInterface
public static void setExitEnabled(boolean enabled)
public final void setSaveFile(String filename)
public final void setTrackLocationsVisited(boolean track)
public final void setWorldFile(String filename)
public final void start()
start
in interface ProgramInterface
public String getTitle()
public void print(Object value)
public void print(String value)
public void println()
public void println(Object value)
public void println(String value)
public void setTitle(String title)
public void turnLeft()
turnLeft
in interface KarelInterface
public void pickBeeper()
pickBeeper
in interface KarelInterface
public void putBeeper()
putBeeper
in interface KarelInterface
public boolean frontIsClear()
frontIsClear
in interface KarelInterface
public boolean frontIsBlocked()
frontIsBlocked
in interface KarelInterface
public boolean leftIsClear()
leftIsClear
in interface KarelInterface
public boolean leftIsBlocked()
leftIsBlocked
in interface KarelInterface
public boolean rightIsClear()
rightIsClear
in interface KarelInterface
public boolean rightIsBlocked()
rightIsBlocked
in interface KarelInterface
public boolean beepersPresent()
beepersPresent
in interface KarelInterface
public boolean noBeepersPresent()
noBeepersPresent
in interface KarelInterface
public boolean beepersInBag()
beepersInBag
in interface KarelInterface
public boolean noBeepersInBag()
noBeepersInBag
in interface KarelInterface
public boolean facingNorth()
facingNorth
in interface KarelInterface
public boolean facingEast()
facingEast
in interface KarelInterface
public boolean facingSouth()
facingSouth
in interface KarelInterface
public boolean facingWest()
facingWest
in interface KarelInterface
public boolean notFacingNorth()
notFacingNorth
in interface KarelInterface
public boolean notFacingEast()
notFacingEast
in interface KarelInterface
public boolean notFacingSouth()
notFacingSouth
in interface KarelInterface
public boolean notFacingWest()
notFacingWest
in interface KarelInterface
public void pause(double ms)
pause
in interface ProgramInterface
pause
in interface KarelInterface
public static void main(String[] args)
public void setParameterTable(Map<String,String> table)
setParameterTable
in interface ProgramInterface
public void setStartupObject(Object obj)
setStartupObject
in interface ProgramInterface
public void start(String[] args)
KarelProgram
containing this Karel instance,
passing it the specified arguments.start
in interface ProgramInterface
public Point getLocation()
getLocation
in interface KarelInterface
public void setLocation(Point pt)
setLocation
in interface KarelInterface
public void setLocation(int x, int y)
setLocation
in interface KarelInterface
public int getDirection()
getDirection
in interface KarelInterface
public void setDirection(int dir)
setDirection
in interface KarelInterface
public int getBeepersInBag()
getBeepersInBag
in interface KarelInterface
public void setBeepersInBag(int nBeepers)
setBeepersInBag
in interface KarelInterface
public KarelWorld getWorld()
getWorld
in interface KarelInterface
public void setWorld(KarelWorld world)
setWorld
in interface KarelInterface
protected void checkWorld(String caller)
public void setDisplayOneFlag(boolean flag)