![]() |
Adventure at Umalu
22nd March, 2013
Rogue-like Dungeon Crawler, written in Java
|
Public Member Functions | |
Terminal () | |
abstract void | refreshScreen () |
abstract char | getKey () throws InterruptedException |
void | bufferChar (Coordinate coord, ColoredChar ch) |
final void | bufferChar (int x, int y, ColoredChar ch) |
ColoredChar | charAt (Coordinate coord) |
final ColoredChar | charAt (int x, int y) |
final void | bufferString (int x, int y, String str, Color color) |
final void | bufferString (Coordinate coord, String str, Color color) |
final void | bufferString (int x, int y, String str) |
final void | bufferString (Coordinate coord, String str) |
void | clearBuffer () |
void | saveBuffer () |
void | recallBuffer () |
void | registerCamera (Camera camera, Coordinate screenCenter) |
final void | registerCamera (Camera camera, int screenCenterX, int screenCenterY) |
Coordinate | cameraCenter (Camera camera) |
boolean | cameraRegistered (Camera camera) |
void | unregisterCamera (Camera camera) |
void | bufferCamera (Camera camera) |
final void | bufferCameras () |
Protected Member Functions | |
final Map< Coordinate, ColoredChar > | getBuffer () |
A terminal used for text mode IO. Features a screen buffer with save and recall, the ability to draw camera views on screen, and keyboard input.
jade.ui.Terminal.Terminal | ( | ) |
void jade.ui.Terminal.bufferCamera | ( | Camera | camera | ) |
Buffers the view field of the camera at its registered screen center. For each location in the view field, the tile on
of the
is buffered relative to the registered screen center. The view field will be buffered regardless of the size on screen, so care should be taken with the way the view field is calculated if a certain size on screen is needed.
camera | the Camera
|
final void jade.ui.Terminal.bufferCameras | ( | ) |
void jade.ui.Terminal.bufferChar | ( | Coordinate | coord, |
ColoredChar | ch | ||
) |
Places a character into the buffer at the specified coordinates.
coord | the location of the character in the buffer |
ch | the character being buffered |
final void jade.ui.Terminal.bufferChar | ( | int | x, |
int | y, | ||
ColoredChar | ch | ||
) |
Places a character into the buffer at the specified coordinates.
x | the x value of the location of the character in the buffer |
y | the y value of the location of the character in the buffer |
ch | the character being buffered |
final void jade.ui.Terminal.bufferString | ( | int | x, |
int | y, | ||
String | str, | ||
Color | color | ||
) |
Buffers a
at (x, y) on the screen with the given
x | the x value of the location of the first character of str |
y | the y value of the location of the first character of str |
str | the String
|
color | the Color
String
|
final void jade.ui.Terminal.bufferString | ( | Coordinate | coord, |
String | str, | ||
Color | color | ||
) |
Buffers a
at location on the screen with the given
coord | the location of the first character of str |
str | the String
|
color | the Color
String
|
final void jade.ui.Terminal.bufferString | ( | int | x, |
int | y, | ||
String | str | ||
) |
Buffers a
at (x, y) on the screen with a default
of white.
x | the x value of the location of the first character of str |
y | the y value of the location of the first character of str |
str | the String
|
final void jade.ui.Terminal.bufferString | ( | Coordinate | coord, |
String | str | ||
) |
Buffers a
at location on the screen with a default
of white.
coord | the location of the first character of str |
str | the String
|
Coordinate jade.ui.Terminal.cameraCenter | ( | Camera | camera | ) |
Returns the registered screen center for the provided
camera | the Camera
|
boolean jade.ui.Terminal.cameraRegistered | ( | Camera | camera | ) |
Returns true if the
is registered.
camera | the Camera
|
ColoredChar jade.ui.Terminal.charAt | ( | Coordinate | coord | ) |
Returns the character at the specified coordinates. Null is returned if nothing is in the buffer.
coord | the location in the buffer being queried |
final ColoredChar jade.ui.Terminal.charAt | ( | int | x, |
int | y | ||
) |
Returns the character at the specified coordinates. Null is returned if nothing is in the buffer.
x | the x value of location in the buffer being queried |
y | the y value of location in the buffer being queried |
void jade.ui.Terminal.clearBuffer | ( | ) |
Clears all contents of the buffer.
|
pure virtual |
Returns the next key press as a
. This method block until a key press is available.
InterruptedException |
Implemented in jade.ui.TermPanel.
void jade.ui.Terminal.recallBuffer | ( | ) |
|
pure virtual |
Refreshes the screen to reflect the current state of the buffer. Until this method is called, no changes to the buffer should be displayed.
InterruptedException |
Implemented in jade.ui.TermPanel, and jade.ui.TiledTermPanel.
void jade.ui.Terminal.registerCamera | ( | Camera | camera, |
Coordinate | screenCenter | ||
) |
Registers a
so that when
is called its view field is drawn at the provided screen center.
camera | the Camera
|
screenCenter | the location on screen where the Camera
|
final void jade.ui.Terminal.registerCamera | ( | Camera | camera, |
int | screenCenterX, | ||
int | screenCenterY | ||
) |
Registers a
so that when
is called its view field is drawn at the provided screen center.
camera | the Camera
|
screenCenterX | the x value of the location on screen where the Camera
|
screenCenterY | the y value of the location on screen where the Camera
|
void jade.ui.Terminal.saveBuffer | ( | ) |
Saves the current state of the buffer. The buffer can be reverted to this state by calling
.
void jade.ui.Terminal.unregisterCamera | ( | Camera | camera | ) |
Unregisters the
so that it cannot be drawn on screen.
camera | the Camera
|