|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.player.GroundFrame
This class is the DisplayPolicy for the ground-view camera. It renders the objects in its view as an inventory list.
The GroundFrame only resends object descriptions if they've changed in a way that's visible to the client. For instance, if the player is standing on an empty road, and the player moves onto a road square identical to the previous one, nothing is re-sent.
If only one object in the list changes appearance, only that object is re-sent.
The GroundFrame sends as much of the object as the player overlaps. A Giant standing next to a palm tree will see the whole tree in his ground window.
Field Summary | |
protected GroundCamera |
camera_
|
protected int |
height_
|
protected GameMap |
map_
|
protected Player |
player_
|
protected Predicate |
skipPlayer_
|
protected GroundViewer |
viewer_
|
protected int |
viewx_
|
protected int |
viewy_
|
protected int |
width_
|
Constructor Summary | |
GroundFrame(Player player)
Constructs a new GroundFrame to view the ground under the specified player. |
Method Summary | |
void |
addUpdateRegions(MapDirtyRegions regions)
Adds in all the cells in the map that have become invalid since this method was last called. |
boolean |
canSee(int x,
int y)
Determines whether the player has a clear line of sight to the specified map location. |
boolean |
checkAdd(GameObject obj)
Returns true if the player can actually see this object. |
void |
doRayCast()
Not applicable for this kind of frame. |
java.util.List |
getLists()
Returns a list of object descriptors that are going to the client. |
java.util.List |
getObjects()
Returns a list of GroundObjDescriptors that were gathered in the last visit to the map. |
void |
grabAll()
Tells the frame to grab the entire view (rather than just selected areas). |
void |
grabObjects()
This is how the DisplayPolicy is told to take a snapshot of invalid camera area(s) added by calls to addUpdateRect(). |
void |
setBounds(int x,
int y,
int width,
int height,
GameMap map)
Sets the bounds of the frame. |
void |
setBounds(int x,
int y,
int width,
int height,
GameMap map,
boolean raycast)
Sets the bounds of the frame. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int viewx_
protected int viewy_
protected int width_
protected int height_
protected Player player_
protected GameMap map_
protected GroundViewer viewer_
protected GroundCamera camera_
protected Predicate skipPlayer_
Constructor Detail |
public GroundFrame(Player player)
player
- the player to viewMethod Detail |
public void addUpdateRegions(MapDirtyRegions regions)
DisplayPolicy
addUpdateRegions
in interface DisplayPolicy
regions
- a matrix, the size of the map, that has
all areas that have become invalid in the map since the
last camera refresh.public void grabObjects()
grabObjects
in interface DisplayPolicy
public void grabAll()
grabAll
in interface DisplayPolicy
public void doRayCast()
doRayCast
in interface DisplayPolicy
public java.util.List getObjects()
public java.util.List getLists()
GroundViewer.getLists()
public void setBounds(int x, int y, int width, int height, GameMap map, boolean raycast)
setBounds
in interface DisplayPolicy
x
- the camera left sidey
- the camera top sidewidth
- the view width, in map coordinatesheight
- the view height, in map coordinatesmap
- the GameMap the camera is currently viewingraycast
- true to redo the ray-caster, false to skippublic void setBounds(int x, int y, int width, int height, GameMap map)
setBounds
in interface DisplayPolicy
x
- the camera left sidey
- the camera top sidewidth
- the view width, in map coordinatesheight
- the view height, in map coordinatesmap
- the GameMap the camera is currently viewingpublic boolean canSee(int x, int y)
canSee
in interface DisplayPolicy
public boolean checkAdd(GameObject obj)
DisplayPolicy
checkAdd
in interface DisplayPolicy
obj
- the object to consider for adding
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |