|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface provides a way to change the drawing policy without changing any of the GameMap code. Each Camera in the game has a DrawingPolicy object that's responsible for collecting the objects in the view and rendering them somehow.
Method Summary | |
void |
addUpdateRegions(MapDirtyRegions changes)
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()
Called when the frame needs to recompute its visibility (using the raycaster). |
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 the invalid camera area(s). |
void |
setBounds(int x,
int y,
int width,
int height,
GameMap map)
Tells the DisplayPolicy what area the camera is viewing. |
void |
setBounds(int x,
int y,
int width,
int height,
GameMap map,
boolean raycast)
Tells the DisplayPolicy what area the camera is viewing. |
Method Detail |
public void addUpdateRegions(MapDirtyRegions changes)
changes
- 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()
public void grabAll()
public void setBounds(int x, int y, int width, int height, GameMap map, boolean raycast)
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)
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 void doRayCast()
public boolean canSee(int x, int y)
public boolean checkAdd(GameObject obj)
obj
- the object to consider for adding
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |