Constructor and Description |
---|
FogOfWarStrategy()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
create(MapTile<?,T> map)
Constructor.
|
boolean |
hasFogOfWar()
Check if fog of war is enabled.
|
boolean |
isFogged(EntityStrategy entity)
Check if the entity is current hidden by the fog of war.
|
boolean |
isFogged(int tx,
int ty)
In case of active fog of war, check if tile is hidden by fog.
|
boolean |
isVisited(int tx,
int ty)
In case of active fog of war, check if tile has been discovered.
|
void |
render(com.b3dgs.lionengine.Graphic g,
CameraStrategy camera)
Render fog map from camera viewpoint, showing a specified area.
|
void |
setFogOfWar(boolean hide,
boolean fog)
Set fog of war state.
|
void |
setFogTiles(com.b3dgs.lionengine.drawable.SpriteTiled hide,
com.b3dgs.lionengine.drawable.SpriteTiled fog)
Set fog tilesheet reference.
|
void |
setPlayerId(int id)
Set player id, to know which player has to be fogged.
|
<E extends EntityStrategy> |
update(Collection<E> entities)
Update entities field of view (fog of war).
|
public void setPlayerId(int id)
id
- The player idpublic <E extends EntityStrategy> void update(Collection<E> entities)
E
- The entity type.entities
- The entities reference.public void render(com.b3dgs.lionengine.Graphic g, CameraStrategy camera)
g
- The graphic output.camera
- The camera viewpoint.public void setFogTiles(com.b3dgs.lionengine.drawable.SpriteTiled hide, com.b3dgs.lionengine.drawable.SpriteTiled fog)
hide
- The hide tilesheet.fog
- The fog tilesheet.public void setFogOfWar(boolean hide, boolean fog)
hide
- true
to enable map hiding, false
else.fog
- true
to enable fog map, false
else.public boolean hasFogOfWar()
true
if fog of war is enabled, false
else.public boolean isFogged(EntityStrategy entity)
entity
- The entity to check.true
if hidden, false
else.public boolean isVisited(int tx, int ty)
tx
- The horizontal tile.ty
- The vertical tile.true
if already discovered, false
else.public boolean isFogged(int tx, int ty)
tx
- The horizontal tile.ty
- The vertical tile.true
if hidden by fog, false
else.Copyright © 2014 Byron 3D Games Studio. All rights reserved.