The FogExploration document which applies to this canvas view
A status flag for whether the layer initialization workflow has succeeded
Track whether we have pending fog updates which have not yet been saved to the database
Texture extractor
The fog refresh count. If > to the refresh threshold, the fog texture is saved to database. It is then reinitialized to 0.
Matrix used for fog rendering transformation.
A debounced function to save fog of war exploration once a continuous stream of updates has concluded.
Handling of the concurrency for fog loading, saving and reset.
Define the number of fog refresh needed before the fog texture is extracted and pushed to the server.
The exploration SpriteMesh which holds the fog exploration texture.
The configured options used for the saved fog-of-war texture.
Does the currently viewed Scene support Token field of vision?
Does the currently viewed Scene support fog of war exploration?
Initialize fog of war - resetting it when switching scenes or re-drawing the canvas
Clear the fog and reinitialize properties (commit and save in non reset mode)
Once a new Fog of War location is explored, composite the explored container with the current staging sprite. Once the number of refresh is > to the commit threshold, save the fog texture to the database.
Load existing fog of war data from local storage and populate the initial exploration sprite
Dispatch a request to reset the fog of war exploration status for all users within this Scene. Once the server has deleted existing FogExploration documents, the _onReset handler will re-draw the canvas.
Request a fog of war save operation. Note: if a save operation is pending, we're waiting for its conclusion.
If fog of war data is reset from the server, deactivate the current fog and initialize the exploration.
Load existing fog of war data from local storage and populate the initial exploration sprite
Request a fog of war save operation. Note: if a save operation is pending, we're waiting for its conclusion.
Update the fog exploration document with provided data.
Deactivate fog of war. Clear all shared containers by unlinking them from their parent. Destroy all stored textures and graphics.
If fog of war data is reset from the server, deactivate the current fog and initialize the exploration.
A fog of war management class which is the singleton canvas.fog instance.