|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrle.core.vm.PlugInBase
rle.core.ui.CameraModelBase
public class CameraModelBase
Handles the internals that drive the Camera display.
This class listens for several types of events: ThingListener - to respond when things move on the board BoardListener - to respond to insertions/removals from the board RuntimeDataListener - respond to changes in interesting parameters of the observer, such as view-radius, infravision, etc.
| Field Summary | |
|---|---|
protected PlayPerspective |
perspective
|
| Fields inherited from class rle.core.vm.PlugInBase |
|---|
config, context, parameters |
| Constructor Summary | |
|---|---|
CameraModelBase()
|
|
| Method Summary | |
|---|---|
void |
addListener(CameraModelListener l)
|
void |
center()
Calls centerOn(getObserver()) |
void |
centerOn(Thing t)
Set the camera's location such that t is at center. |
protected java.util.Set<RLPoint> |
computeFieldOfView()
Compute field-of-view. |
void |
dataChange(RuntimeDataEvent event)
Respond to a RuntimeData change by one of the things we're interested in. |
Board |
getBoard()
|
RLRectangle |
getBounds()
|
Camera |
getCamera()
Retrieve the camera. |
RLPoint |
getCameraLocation()
The camera's location, in the board coordinate system. |
Thing |
getObserver()
Retrieve the observer. |
PlayPerspective |
getPerspective()
|
RLDimension |
getTileSize()
Retrieve the tile size. |
RLDimension |
getViewportSize()
The size in grids of the viewport. |
boolean |
isKnown(Thing t)
Is it known? Something is known if the observer is aware of it, whether or not it is actually drawn by the camera. |
java.util.TreeSet<Thing> |
knownThings(RLPoint boardLoc)
All known Objects at a board location in the following order: player, npc, item, terrain. |
void |
locationChange(ThingMoveEvent event)
When something moves... |
void |
removeListener(CameraModelListener l)
|
void |
setBoard(Board b)
|
void |
setCamera(Camera c)
Set the camera. |
void |
setCameraLocation(RLPoint loc)
Set the camera's location, in the board coordinate system. |
void |
setObserver(Thing t)
Set the observer. |
void |
setPerspective(PlayPerspective pp)
|
void |
setTileSize(RLDimension d)
Set the tile size. |
void |
thingInsert(ThingInsertEvent event)
When any thing is added to the board, we need to listen for its location changes. |
void |
thingRemove(ThingRemoveEvent event)
When anything is removed from the board we stop listening to it and forget it. |
void |
uninstall()
Uninstall this CameraModel. |
void |
updateObserverFieldOfView()
Update the observer's field of view |
| Methods inherited from class rle.core.vm.PlugInBase |
|---|
config, getContext, getParameters, paramMap, setConfig, setParameters |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface rle.core.vm.PlugIn |
|---|
config, getContext, paramMap, setConfig, setParameters |
| Field Detail |
|---|
protected PlayPerspective perspective
| Constructor Detail |
|---|
public CameraModelBase()
| Method Detail |
|---|
public void setPerspective(PlayPerspective pp)
setPerspective in interface CameraModelpublic PlayPerspective getPerspective()
getPerspective in interface CameraModelpublic boolean isKnown(Thing t)
isKnown in interface CameraModelpublic RLRectangle getBounds()
getBounds in interface CameraModelpublic java.util.TreeSet<Thing> knownThings(RLPoint boardLoc)
knownThings in interface CameraModelpublic void center()
center in interface CameraModelpublic void setObserver(Thing t)
setObserver in interface CameraModelpublic Thing getObserver()
getObserver in interface CameraModelpublic RLDimension getTileSize()
getTileSize in interface CameraModelpublic void setTileSize(RLDimension d)
setTileSize in interface CameraModelpublic void centerOn(Thing t)
centerOn in interface CameraModelpublic RLPoint getCameraLocation()
getCameraLocation in interface CameraModelpublic void setCameraLocation(RLPoint loc)
setCameraLocation in interface CameraModelloc - public RLDimension getViewportSize()
getViewportSize in interface CameraModelpublic void setCamera(Camera c)
setCamera in interface CameraModelpublic Camera getCamera()
getCamera in interface CameraModelpublic void thingInsert(ThingInsertEvent event)
thingInsert in interface BoardListenerpublic void thingRemove(ThingRemoveEvent event)
thingRemove in interface BoardListenerpublic void locationChange(ThingMoveEvent event)
locationChange in interface ThingListenerpublic void updateObserverFieldOfView()
updateObserverFieldOfView in interface CameraModelprotected java.util.Set<RLPoint> computeFieldOfView()
public void dataChange(RuntimeDataEvent event)
Observer view-radius - changes affect size of field-of-view area All changes to any data that could affect appearance
dataChange in interface RuntimeDataListenerpublic void addListener(CameraModelListener l)
addListener in interface CameraModelpublic void removeListener(CameraModelListener l)
removeListener in interface CameraModelpublic void uninstall()
uninstall in interface CameraModelpublic void setBoard(Board b)
setBoard in interface CameraModelpublic Board getBoard()
getBoard in interface CameraModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||