|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.map.AbstractTiledFogOfWar<TTile>
TTile
- tile type used.public abstract class AbstractTiledFogOfWar<TTile extends DefaultTile>
Designed to handle a fog of war (discovering tile and hidding tile).
Constructor Summary | |
---|---|
AbstractTiledFogOfWar()
Create a new tile based fog of war. |
Method Summary | |
---|---|
void |
create(TileBasedMap<TTile> map)
Create fog from existing map. |
boolean |
hasFogOfWar()
Check if fog of war is enabled. |
boolean |
isFogged(int v,
int h)
In case of active fog of war, check if tile is hidden by fog. |
boolean |
isVisited(int v,
int h)
In case of active fog of war, check if tile has been discovered. |
protected abstract void |
onFogChanges(AbstractEntry<?,?,?> entry)
Called when an entry make the fog change. |
void |
render(java.awt.Graphics2D g,
StrategyCamera camera,
int inTileWidth,
int inTileHeight)
Render fog map from camera viewpoint, showing a specified area. |
void |
setFogOfWar(boolean hide,
boolean fog)
Set fog of war state. |
void |
setFogTiles(TiledSprite hide,
TiledSprite fog)
Set fog tilesheet reference. |
void |
setOwner(java.util.Set<?> entrys,
int id)
Set owner id, to know which player has to be fogged. |
void |
updateEntryFOV(AbstractEntry<?,?,?> entry)
Update entry field of view (fog of war). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractTiledFogOfWar()
Method Detail |
---|
public void create(TileBasedMap<TTile> map)
map
- map reference.public void setOwner(java.util.Set<?> entrys, int id)
entrys
- entrys listid
- owner idpublic void updateEntryFOV(AbstractEntry<?,?,?> entry)
entry
- entry reference.protected abstract void onFogChanges(AbstractEntry<?,?,?> entry)
entry
- entry which make the fog update.public void setFogTiles(TiledSprite hide, TiledSprite fog)
hide
- hide tilesheet.fog
- fog tilesheet.public void setFogOfWar(boolean hide, boolean fog)
hide
- true to enable map hidding.fog
- true to enable fog map.public boolean hasFogOfWar()
public boolean isVisited(int v, int h)
v
- vertical tile.h
- horizontal tile.
public boolean isFogged(int v, int h)
v
- vertical tile.h
- horizontal tile.
public void render(java.awt.Graphics2D g, StrategyCamera camera, int inTileWidth, int inTileHeight)
g
- graphic output.camera
- camera viewpoint.inTileWidth
- number of rendered tiles in width.inTileHeight
- number of rendered tiles in height.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |