|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbot.CoreInformer
bot.GraphicInformer
Inform of robot status via graphic display.
| Field Summary | |
static String |
BOT_IMAGE_NAME
|
static String |
CLAW_IMAGE_NAME
|
static String |
FEELER_IMAGE_NAME
|
static String |
KEY_IMAGE_NAME
|
static double |
MAXIMUM_TIME_PER_STEP
|
static int |
MINIMUM_SLEEP_TIME
|
static double |
MINIMUM_TIME_PER_STEP
|
int |
render_speed
how fast the animation frame rate is. |
static String |
SQUARE_IMAGE_NAME
|
static int |
STATE_OVER
|
static int |
STATE_RESET
|
static int |
STATE_RUNNING
|
static int |
STATE_STEPPING
|
static int |
STATE_STOPPED
|
int |
step_speed
How long each step takes in toto (step being any call to this informer). |
static String |
WALL_IMAGE_NAME
|
| Fields inherited from class bot.CoreInformer |
runner |
| Fields inherited from interface bot.Informer |
CHAR_BY_CHAR_INPUT, STRING_INPUT |
| Constructor Summary | |
GraphicInformer(Runner runner)
|
|
| Method Summary | |
void |
alert(String s)
Put up alert message on screen. |
protected void |
beginAction()
Begin a step. |
void |
beginSimulation(boolean pause)
This waits for the "Go" button to be hit. |
Image |
botImage()
The current image the bot is using. |
void |
endAction()
End the action. |
protected void |
endAction(int speed_factor)
|
void |
endGame(boolean won)
|
void |
feel()
Bot Action |
Image |
findThingImage(String name)
Find a thing's image by name and return it. |
Image |
findThingImage(Thing thing)
|
String |
getInput()
Returns user input from keyboard. |
void |
goHit()
|
void |
grab()
Bot Action |
void |
inform(String s)
A message of something that transpired (for example, used object.) |
void |
land()
Put the bot on the board. |
void |
paintBot()
|
void |
paintBot(Image botimg)
Paint the bot as the passed image in its given location. |
void |
paintBot(Point where,
Image botimg)
|
void |
paintSquare(Point p)
Paint a square, based on what is currently in it (i.e. |
void |
paintSquare(Square sq)
|
void |
pausing(boolean ison,
String why)
If we want to pause, and display a message. |
void |
place()
Bot Action |
void |
redraw()
Redraw the board from scratch (for if the board has massivly changed for some reason.) |
void |
relocate(Point from,
Point to)
Bot Action - when Bot changes position. |
protected void |
renderSleep()
Sleep between frames of animation cycle of a single step (i.e. |
protected void |
renderSleep(long startpoint)
|
void |
reset(BotBoard botboard)
Reset the board back to a new passed board. |
void |
resetHit()
|
void |
resetTick()
|
void |
rest()
Bot Action |
void |
say(String s)
Bot Action--it says something |
void |
selectBoard()
Inform user that they must select a bot, and then have them select it. |
void |
selectBot()
Inform user that they must select a bot, and then have them select it. |
void |
sendInput(char c)
Accept input from alternative sources (such as other components getting key events. |
void |
setAppearance(String toWhat)
Set bot's appearance. |
void |
setBoard(Board bd)
Setting the board to display to passed board. |
void |
setInputMode(int mode)
Do we return input at each character? |
void |
setRenderSpeed(int spd)
|
void |
setStepSpeed(int spd)
|
void |
setupSquare(Point sqloc)
Set checkercanvas to have appropriate graphics for the given loc (find square if it exists, and use default if not). |
void |
setupSquare(Square sq)
Set checkercanvas to have appropriate graphics for the square. |
void |
stepHit()
|
void |
stopHit()
|
protected void |
tick()
|
void |
touch(Point where)
Bot Action Call to say the given point has been modified. |
void |
turn(int new_direction)
The bot turns to face the new passed direction. |
void |
waitForReset()
Wait for the reset button to be hit. |
| Methods inherited from class bot.CoreInformer |
getCurrentTime, getRunner, inAction, waitForGo |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface bot.Informer |
getCurrentTime, getRunner |
| Field Detail |
public static String WALL_IMAGE_NAME
public static String SQUARE_IMAGE_NAME
public static String BOT_IMAGE_NAME
public static String FEELER_IMAGE_NAME
public static String CLAW_IMAGE_NAME
public static final String KEY_IMAGE_NAME
public static int STATE_RUNNING
public static int STATE_STOPPED
public static int STATE_STEPPING
public static int STATE_OVER
public static int STATE_RESET
public int step_speed
public int render_speed
public static final double MAXIMUM_TIME_PER_STEP
public static final double MINIMUM_TIME_PER_STEP
public static final int MINIMUM_SLEEP_TIME
| Constructor Detail |
public GraphicInformer(Runner runner)
| Method Detail |
public void reset(BotBoard botboard)
reset in interface Informerreset in class CoreInformer
public void pausing(boolean ison,
String why)
pausing in interface Informerpublic void setBoard(Board bd)
setBoard in interface InformersetBoard in class CoreInformerpublic void redraw()
redraw in interface Informerpublic void alert(String s)
alert in interface Informers - The message to display.public void setupSquare(Square sq)
public void setupSquare(Point sqloc)
public void paintSquare(Point p)
public void paintSquare(Square sq)
public void paintBot()
public void paintBot(Image botimg)
public void paintBot(Point where,
Image botimg)
public Image findThingImage(Thing thing)
public Image findThingImage(String name)
protected void beginAction()
beginAction in class CoreInformerpublic void endAction()
endAction in interface InformerendAction in class CoreInformerprotected void endAction(int speed_factor)
protected void renderSleep()
protected void renderSleep(long startpoint)
public void setInputMode(int mode)
setInputMode in interface Informerpublic void sendInput(char c)
public String getInput()
getInput in interface Informerpublic void land()
land in interface Informerland in class CoreInformerpublic void setAppearance(String toWhat)
setAppearance in interface InformersetAppearance in class CoreInformer
public void relocate(Point from,
Point to)
Informer
relocate in interface Informerrelocate in class CoreInformerpublic void touch(Point where)
Informer
touch in interface Informertouch in class CoreInformerpublic Image botImage()
public void turn(int new_direction)
turn in interface Informerturn in class CoreInformerpublic void rest()
Informer
rest in interface Informerrest in class CoreInformerpublic void say(String s)
Informer
say in interface Informersay in class CoreInformerpublic void inform(String s)
Informer
inform in interface Informerinform in class CoreInformerpublic void grab()
Informer
grab in interface Informergrab in class CoreInformerpublic void feel()
Informer
feel in interface Informerfeel in class CoreInformerpublic void place()
Informer
place in interface Informerplace in class CoreInformerpublic void endGame(boolean won)
endGame in interface InformerendGame in class CoreInformerpublic void setRenderSpeed(int spd)
public void setStepSpeed(int spd)
public void stopHit()
public void goHit()
public void resetHit()
public void stepHit()
public void beginSimulation(boolean pause)
beginSimulation in interface Informerpublic void waitForReset()
waitForReset in interface InformerwaitForReset in class CoreInformerprotected void tick()
tick in class CoreInformerpublic void resetTick()
resetTick in class CoreInformerpublic void selectBot()
selectBot in interface Informerpublic void selectBoard()
selectBoard in interface Informer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||