|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.adom.jade.ui.MapView
Memorizes which parts of the map are currently visibly and which are not. It also memorizes all known map parts (visited but not currently visible). Additionally this class memorizes the current on-screen representation for all visited places.
This class is the most direct connector between the rather abstractmap structure and the very real display chosen be the UI to visalize the map.
| Constructor Summary | |
|---|---|
MapView(Map theMap)
Creates a new map view for a given map. |
|
| Method Summary | |
|---|---|
int |
getBottomViewBoundary()
Returns the bottom-most boundary (unwrapped) of the view of the central being. |
int |
getLeftViewBoundary()
Returns the left-most boundary (unwrapped) of the view of the central being. |
int |
getRightViewBoundary()
Returns the right-most boundary (unwrapped) of the view of the central being. |
TileRepresentation |
getTileRepresentation(int x,
int y)
Returns the representation for a given position. |
int |
getTopViewBoundary()
Returns the top-most boundary (unwrapped) of the view of the central being. |
MapArea |
getUpdatedViewArea()
Returns a map area describing those parts of the map that were changed in some visually noticable way since the last call to resetVisibility. |
boolean |
isVisible(int x,
int y)
Determines whether a given position of the map is visible or not. |
void |
mapUpdated(int x,
int y)
Notifies the view of an update. |
void |
resetUpdates()
Resets the update list. |
void |
resetVisibility()
Resets visibility for the complete map. |
void |
setPointOfView(Being being)
Sets the point of view of the PC. |
void |
setTileRepresentation(int x,
int y,
TileRepresentation representation)
Sets the current representation for a given position. |
void |
setVisible(int x,
int y,
boolean visibility)
Marks a given position as visible or not. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapView(Map theMap)
theMap - the map t which this view belongs| Method Detail |
|---|
public boolean isVisible(int x,
int y)
x - the x coordinate for the positiony - the y coordinate for the position
public void setVisible(int x,
int y,
boolean visibility)
x - the x coordinate for the positiony - the y coordinate for the positionvisibility - a boolean flag determining whether the position is
visible or notpublic void resetVisibility()
public void setTileRepresentation(int x,
int y,
TileRepresentation representation)
x - the x coordinate for the positiony - the y coordinate for the positionrepresentation - the representation for the given position
public TileRepresentation getTileRepresentation(int x,
int y)
x - the x coordinate for the positiony - the y coordinate for the position
null
will be returned.public MapArea getUpdatedViewArea()
resetVisibility.
public void setPointOfView(Being being)
being - the being to use as the reference being for the next
map view
public void mapUpdated(int x,
int y)
mapUpdated in interface MapListenerx - the x coordinate of the updated positiony - the y coordinate of the updated positionpublic void resetUpdates()
public int getLeftViewBoundary()
public int getRightViewBoundary()
public int getTopViewBoundary()
public int getBottomViewBoundary()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||