|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrle.core.vm.PlugInBase
rle.core.board.Board
public class Board
A Board's sole function is to track the location of the various Thing's in the player's environment. Listeners may register to receive notification when Things change locations via the addBoardListener() method.
Field Summary | |
---|---|
protected RLRectangle |
bounds
We store the bounds instead of just the size because RLRectangle has some useful methods, especially contains(). |
protected java.util.HashSet<Creature> |
creatures
|
protected java.util.HashSet<Item> |
items
|
protected int |
level
|
protected java.util.TreeSet<Thing>[][] |
stuff
|
protected java.util.Comparator |
stuffComparator
The comparator used to sort Things stored at individual locations on the Board. |
protected java.util.HashSet<Terrain> |
terrains
|
protected java.util.HashSet<Thing> |
things
|
Fields inherited from class rle.core.vm.PlugInBase |
---|
config, context, parameters |
Constructor Summary | |
---|---|
Board()
|
Method Summary | |
---|---|
void |
addBoardListener(BoardListener listener)
Add a BoardListener that will be notified of all property changes |
boolean |
contains(RLPoint p)
Return whether a RLPoint is contained in this Board. |
Creature |
creature(RLPoint p)
Return the creature at p, if any. |
java.util.Set<Creature> |
creatures()
Retrieve the creatures in this Board. |
int |
getHeight()
The height of this Board. |
int |
getLevel()
|
int |
getWidth()
The width of this Board. |
Inventory |
inventory(RLPoint p)
Return an Inventory representing the items at p. |
boolean |
isDay()
|
Item |
item(RLPoint p)
|
java.util.Set<Item> |
items()
Retrieve the items in this Board. |
java.util.Set<Item> |
items(Locator l)
|
java.util.Set<Item> |
items(RLPoint p)
|
void |
place(Thing t,
Locator l)
Associate Thing t with Locator l. |
void |
place(Thing t,
RLPoint p)
Convenience method to place a thing without explicitly creating a locator. |
void |
remove(Thing t)
Remove. |
void |
removeBoardListener(BoardListener listener)
Remove a BoardListener that was to be notified of all property changes |
void |
setBounds(RLRectangle r)
Change the dimensions of this Board. |
void |
setConfig(InfoView view)
Overridden to allocate structures based on board height and width from the VariantMgr. |
void |
setDay(boolean b)
|
void |
setLevel(int level)
|
Terrain |
terrain(RLPoint p)
Return the terrain at p, if any. |
java.util.Set<Terrain> |
terrains()
Retrieve the terrains in this Board. |
java.util.List<Terrain> |
terrains(Locator loc)
Return the terrains intersecting a Locator. |
java.util.Set<Thing> |
things()
All Thing's on the board. |
java.util.TreeSet<Thing> |
things(Locator loc)
Return the things intersecting a Locator. |
java.util.TreeSet<Thing> |
things(RLPoint p)
Return the Things intersecting a particular point. |
Methods inherited from class rle.core.vm.PlugInBase |
---|
config, getContext, getParameters, paramMap, setParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RLRectangle bounds
protected int level
protected java.util.TreeSet<Thing>[][] stuff
protected java.util.HashSet<Thing> things
protected java.util.HashSet<Item> items
protected java.util.HashSet<Creature> creatures
protected java.util.HashSet<Terrain> terrains
protected java.util.Comparator stuffComparator
Constructor Detail |
---|
public Board()
Method Detail |
---|
public int getLevel()
public void setLevel(int level)
public int getWidth()
public int getHeight()
public boolean contains(RLPoint p)
public void setConfig(InfoView view)
setConfig
in interface PlugIn
setConfig
in class PlugInBase
public void setBounds(RLRectangle r)
public java.util.Set<Thing> things()
public java.util.Set<Item> items()
public java.util.Set<Creature> creatures()
public java.util.Set<Terrain> terrains()
public void remove(Thing t)
public void place(Thing t, RLPoint p)
public boolean isDay()
public void setDay(boolean b)
public void place(Thing t, Locator l)
public Creature creature(RLPoint p)
public Item item(RLPoint p)
public java.util.Set<Item> items(Locator l)
public java.util.Set<Item> items(RLPoint p)
public Inventory inventory(RLPoint p)
public Terrain terrain(RLPoint p)
public java.util.List<Terrain> terrains(Locator loc)
public java.util.TreeSet<Thing> things(RLPoint p)
public java.util.TreeSet<Thing> things(Locator loc)
public void addBoardListener(BoardListener listener)
listener
- public void removeBoardListener(BoardListener listener)
listener
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |