Terrain Engine 2D  1.10
A 2D Block Engine
TerrainDataTemplate Class Reference
Inheritance diagram for TerrainDataTemplate:
TerrainEngine2D.TerrainData

Public Member Functions

override void GenerateData ()
 Procedurally generates world block data using random and pseudo-random functions More...
 

Additional Inherited Members

- Protected Types inherited from TerrainEngine2D.TerrainData
enum  Fluid { Fluid.Empty, Fluid.Solid, Fluid.Full }
 
- Protected Member Functions inherited from TerrainEngine2D.TerrainData
int PerlinNoise (int x, int y, float scale, float mag, float exp)
 Perlin Noise Function for generating block height data More...
 
void AddBlock (int x, int y, byte layer, byte blockType, float probability=100f)
 Sets the world block data of a specified layer to a specific block More...
 
bool DoAddBlock (double probability)
 Checks if block should be set based on probability More...
 
void RemoveBlock (int x, int y, byte layer)
 Removes blocks from a specified layer and coordinate More...
 
void RemoveAllBlocks (int x, int y)
 Removes blocks from all layers at a coordinate More...
 
bool IsBlockAt (int x, int y, byte layer, int width=1, int height=1)
 Checks if there is a block at a specific coordinate or area in the layer More...
 
void SetFluidType (int x, int y, Fluid fluidType)
 Set fluid type at a specified coordinate More...
 
void AddFluid (int x, int y, float weight)
 Add fluid to a block at a coordinate More...
 
void RemoveFluid (int x, int y, int width=1, int height=1)
 Remove fluid from an area More...
 
void GeneratePool (int x, int y, float weight, int maxY, Vector2 key, bool newPool=true)
 Recursive function for generating a pool of fluid below a threshold, previously set fluid blocks will be overwritten More...
 
void ClearFluid (int x, int y, int maxY)
 Recursive function for removing fluid below a threshold More...
 
- Protected Attributes inherited from TerrainEngine2D.TerrainData
World world
 
FluidDynamics fluidDynamics
 
Vector2 [,] fluidKey
 
int seed
 
System.Random random
 

Member Function Documentation

◆ GenerateData()

override void TerrainDataTemplate.GenerateData ( )
virtual

Procedurally generates world block data using random and pseudo-random functions

Parameters
worldReference to the world to access block arrays

Reimplemented from TerrainEngine2D.TerrainData.


The documentation for this class was generated from the following file: