Class CellMineralsLayerGroup
Represents a group of cell minerals layers within a hexagonal terrain system, providing functionality to create and initialize terrain layers based on specified parameters.
Inheritance
Inherited Members
Namespace: Fwt.HexTerrains.Minerals.Data
Assembly: fwt.hexterrains.dll
Syntax
public class CellMineralsLayerGroup : HexTerrainLayerGroup<CellMineralsLayer>, IDisposable, ISerializableTerrainLayer, IComponentData, IQueryTypeParameter
Remarks
This class extends HexTerrainLayerGroup to manage CellMineralsLayer instances and implements IComponentData for compatibility with ECS architectures. It enables customized initialization and creation of terrain layers using initialization arguments, supporting flexible configuration of mineral layers in hex-based terrains.
Methods
CreateTerrainLayer<TInitArgs>(TInitArgs)
This function is called to create a new terrain layer of type TTerrainLayer. Default implementation uses an Activator to create a new instance of TTerrainLayer, expecting that the TTerrainLayer has a parameterless constructor. Override this function in your derived class to have a custom way of creating a terrain layer.
Declaration
public override CellMineralsLayer CreateTerrainLayer<TInitArgs>(TInitArgs initArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| TInitArgs | initArgs | Initialization arguments for creating a layer |
Returns
| Type | Description |
|---|---|
| CellMineralsLayer | Returns a created instance of the terrain layer of type (inherited from) TTerrainLayer |
Type Parameters
| Name | Description |
|---|---|
| TInitArgs | Init terrain layer arguments object that is used in create layer process. Default implementation ignores this parameter, but in your overrided implementation it may be needed |
Overrides
InitTerrainLayer<TInitArgs>(CellMineralsLayer, HexTerrainSettings, TInitArgs)
Initializes the terrain layer with the specified settings and initialization arguments.
Declaration
public override void InitTerrainLayer<TInitArgs>(CellMineralsLayer layer, HexTerrainSettings settings, TInitArgs initArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| CellMineralsLayer | layer | nested terrain layer to be initialized with provided init args |
| HexTerrainSettings | settings | HexTerrainSettings of the terrain this layers list is attached to |
| TInitArgs | initArgs | Initialization arguments for provided nested terrain layer |
Type Parameters
| Name | Description |
|---|---|
| TInitArgs | Initialization arguments for a nested terrain layer |