![]() |
Adventure at Umalu
22nd March, 2013
Rogue-like Dungeon Crawler, written in Java
|
Public Member Functions | |
World (int width, int height) | |
void | playertick () |
void | tick () |
int | width () |
int | height () |
List< Class<?extends Actor > > | getDrawOrder () |
List< Class<?extends Actor > > | getActOrder () |
void | addActor (Actor actor, int x, int y) |
final void | addActor (Actor actor, Coordinate coord) |
final void | addActor (Actor actor, Dice dice) |
final void | addActor (Actor actor) |
void | removeActor (Actor actor) |
void | removeExpired () |
final< T extends Actor > T | getActorAt (Class< T > cls, Coordinate pos) |
final< T extends Actor > Collection< T > | getActorsAt (Class< T > cls, Coordinate pos) |
List< ColoredChar > | lookAll (int x, int y) |
final List< ColoredChar > | lookAll (Coordinate pos) |
final ColoredChar | look (int x, int y) |
final ColoredChar | look (Coordinate pos) |
ColoredChar | tileAt (int x, int y) |
void | viewable (int x, int y) |
Boolean | isviewable (int x, int y) |
final ColoredChar | tileAt (Coordinate coord) |
boolean | passableAt (int x, int y) |
final boolean | passableAt (Coordinate coord) |
void | setTile (ColoredChar face, boolean passable, int x, int y) |
final void | setTile (ColoredChar face, boolean passable, Coordinate coord) |
Coordinate | getOpenTile (Dice dice, int x1, int y1, int x2, int y2) |
final Coordinate | getOpenTile (Dice dice, Coordinate topLeft, Coordinate bottomRight) |
final Coordinate | getOpenTile (Dice dice) |
final Coordinate | getOpenTile (int x1, int y1, int x2, int y2) |
final Coordinate | getOpenTile (Coordinate topLeft, Coordinate bottomRight) |
final Coordinate | getOpenTile () |
boolean | insideBounds (int x, int y) |
final boolean | insideBounds (Coordinate pos) |
![]() | |
Messenger () | |
void | appendMessage (String message) |
Iterable< String > | retrieveMessages () |
void | aggregateMessages (Messenger messenger) |
void | filterMessages (Collection< Messenger > filter) |
void | clearMessages () |
Public Attributes | |
Coordinate | playerstart |
Represents a game world on which
can interact.
jade.core.World.World | ( | int | width, |
int | height | ||
) |
void jade.core.World.addActor | ( | Actor | actor, |
int | x, | ||
int | y | ||
) |
final void jade.core.World.addActor | ( | Actor | actor, |
Coordinate | coord | ||
) |
Adds an
to the
at a random open tile, as generated by the specified
with a call to
/
actor | the Actor
|
dice | the random number generator used to find the open tile |
final void jade.core.World.addActor | ( | Actor | actor | ) |
Adds an
to the
at a random open tile, as generated by the global instance of
with a call to
/
actor | the Actor
|
final<T extends Actor> T jade.core.World.getActorAt | ( | Class< T > | cls, |
Coordinate | pos | ||
) |
Returns an
of the given class at the given location, or null if there is none. If there are multiple possible
that could be returned, an arbitrary
is returned.
<T> | the generic type of the class to be returned |
cls | the Class<T extends Actor>
Actor
|
pos | the location being queried |
List<Class<? extends Actor> > jade.core.World.getActOrder | ( | ) |
Returns the act order for the
. This list will affect the
method by changing the priority with which
s will act. Note that if one class in the draw order is a superclass of another in the list, any
of the type of the subclass will act twice in the
method.
final<T extends Actor> Collection<T> jade.core.World.getActorsAt | ( | Class< T > | cls, |
Coordinate | pos | ||
) |
Returns a
of all
of the given class at the given location.
<T> | the generic type of the class type to be returned |
cls | the Class<T extends Actor>
Actor
|
pos | the location being queried |
List<Class<? extends Actor> > jade.core.World.getDrawOrder | ( | ) |
Returns the draw order for the
. This list will affect the
method by changing the priority with which
s will be drawn. Note that if one class in the draw order is a superclass of another in the list, any
of the type of the subclass will be seen twice in the
method.
Coordinate jade.core.World.getOpenTile | ( | Dice | dice, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Gets a randomly chosen open tile on the
within the given bounds. If after 100 randomly selected tiles are closed, then each tile will be checked and the first open tile found is returned. If the entire
is closed, null is returned.
dice | the random number generator used to randomly select tiles |
x1 | the bounds left most value |
y1 | the bounds upper most value |
x2 | the bounds right most value |
y2 | the bounds bottom most value |
final Coordinate jade.core.World.getOpenTile | ( | Dice | dice, |
Coordinate | topLeft, | ||
Coordinate | bottomRight | ||
) |
Gets a randomly chosen open tile on the
within the given bounds. If after 100 randomly selected tiles are closed, then each tile will be checked and the first open tile found is returned. If the entire
is closed, null is returned.
dice | the random number generator used to randomly select tiles |
topLeft | the bounds upper-left most value |
bottomRight | the bounds bottom-right most value |
final Coordinate jade.core.World.getOpenTile | ( | Dice | dice | ) |
Gets a randomly chosen open tile from anywhere on the
. If after 100 randomly selected tiles are closed, then each tile will be checked and the first open tile found is returned. If the entire
is closed, null is returned.
dice | the random number generator used to randomly select tiles |
final Coordinate jade.core.World.getOpenTile | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Gets a randomly chosen open tile on the
within the given bounds. The global instance of
is used as the default parameter for randomly choosing the tiles. If after 100 randomly selected tiles are closed, then each tile will be checked and the first open tile found is returned. If the entire
is closed, null is returned.
x1 | the bounds left most value |
y1 | the bounds upper most value |
x2 | the bounds right most value |
y2 | the bounds bottom most value |
final Coordinate jade.core.World.getOpenTile | ( | Coordinate | topLeft, |
Coordinate | bottomRight | ||
) |
Gets a randomly chosen open tile on the
within the given bounds. The global instance of
is used as the default parameter for randomly choosing the tiles. If after 100 randomly selected tiles are closed, then each tile will be checked and the first open tile found is returned. If the entire
is closed, null is returned.
topLeft | the bounds upper-left most value |
bottomRight | the bounds bottom-right most value |
final Coordinate jade.core.World.getOpenTile | ( | ) |
Gets a randomly chosen open tile from anywhere on the
. The global instance of
is used as the default parameter for randomly choosing the tiles. If after 100 randomly selected tiles are closed, then each tile will be checked and the first open tile found is returned. If the entire
is closed, null is returned.
boolean jade.core.World.insideBounds | ( | int | x, |
int | y | ||
) |
final boolean jade.core.World.insideBounds | ( | Coordinate | pos | ) |
final ColoredChar jade.core.World.look | ( | int | x, |
int | y | ||
) |
Returns the face that should be drawn for the given location. This should be the same as the first face returned by lookAll.
x | the x value of the location being queried |
y | the y value of the location being queried |
final ColoredChar jade.core.World.look | ( | Coordinate | pos | ) |
Returns the face that should be drawn for the given location.
pos | the location being queried |
List<ColoredChar> jade.core.World.lookAll | ( | int | x, |
int | y | ||
) |
Returns every tile that is visible at a given location, ordered such that the tile with highest priority (the tile returned by look) is first, and the lowest priority is last. This last tile will be the face of the actual tile itself. Note that any actor which has a null face will not be included.
x | the x value of the location being queried |
y | the y value of the location being queried |
final List<ColoredChar> jade.core.World.lookAll | ( | Coordinate | pos | ) |
Returns every tile that is visible at a given location, ordered such that the tile with highest priority (the tile returned by look) is first, and the lowest priority is last. This last tile will be the face of the actual tile itself. Note that any actor which has a null face will not be included.
pos | the location being queried |
boolean jade.core.World.passableAt | ( | int | x, |
int | y | ||
) |
Returns true if the tile at the provided (x, y) coordinates is passable.
x | the x value of the position being queried |
y | the y value of the position being queried |
final boolean jade.core.World.passableAt | ( | Coordinate | coord | ) |
Returns true if the tile at the provided
is passable.
coord | the value of the position being queried |
void jade.core.World.removeActor | ( | Actor | actor | ) |
void jade.core.World.removeExpired | ( | ) |
void jade.core.World.setTile | ( | ColoredChar | face, |
boolean | passable, | ||
int | x, | ||
int | y | ||
) |
Sets the face and passable value of the tile at the specified (x, y) location.
face | the new face of the tile |
passable | the new passable value of the tile |
x | the x value of the position being updated |
y | the y value of the position being updated |
final void jade.core.World.setTile | ( | ColoredChar | face, |
boolean | passable, | ||
Coordinate | coord | ||
) |
Sets the face and passable value of the tile at the specified
.
face | the new face of the tile |
passable | the new passable value of the tile |
coord | the value of the position being updated |
void jade.core.World.tick | ( | ) |
ColoredChar jade.core.World.tileAt | ( | int | x, |
int | y | ||
) |
Returns the face of the tile at the provided (x, y) coordinates.
x | the x value of the position being queried |
y | the y value of the position being queried |
final ColoredChar jade.core.World.tileAt | ( | Coordinate | coord | ) |
Returns the face of the tile at the provided coordinates.
coord | the value of the position being queried |