Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class CellEntityLayerGroup

    Represents a group of cell entity layers within a hex-based terrain, providing management and initialization CellEntity layers. CellEntity layers are specialized terrain layers that handle entities associated with terrain cells.

    Inheritance
    object
    HexTerrainLayer
    HexTerrainLayerGroup
    HexTerrainLayerGroup<CellEntityLayer>
    CellEntityLayerGroup
    Implements
    IDisposable
    ISerializableTerrainLayer
    IComponentData
    IQueryTypeParameter
    Inherited Members
    HexTerrainLayerGroup<CellEntityLayer>.LayersCount
    HexTerrainLayerGroup<CellEntityLayer>.Layers
    HexTerrainLayerGroup<CellEntityLayer>.LayersByName
    HexTerrainLayerGroup<CellEntityLayer>.LayerIndexByName
    HexTerrainLayerGroup<CellEntityLayer>.LayerIndexByInstance
    HexTerrainLayerGroup<CellEntityLayer>.Init<TInitLayerArgs>(HexTerrainSettings, IEnumerable<TInitLayerArgs>)
    HexTerrainLayerGroup<CellEntityLayer>.Init(HexTerrainSettings)
    HexTerrainLayerGroup<CellEntityLayer>.InitLayers<TInitLayerArgs>(HexTerrainSettings, IEnumerable<TInitLayerArgs>)
    HexTerrainLayerGroup<CellEntityLayer>.InitLayers(HexTerrainSettings)
    HexTerrainLayerGroup<CellEntityLayer>.GetLayer(int)
    HexTerrainLayerGroup<CellEntityLayer>.GetLayer(string)
    HexTerrainLayerGroup<CellEntityLayer>.CalculateColorMap(JobHandle)
    HexTerrainLayerGroup<CellEntityLayer>.GetLayer<TTargetLayer>(int, bool, string, bool)
    HexTerrainLayerGroup<CellEntityLayer>.GetLayer<TTargetLayer>(string)
    HexTerrainLayerGroup<CellEntityLayer>.GetLayer<TTargetLayer>(int)
    HexTerrainLayerGroup<CellEntityLayer>.GetLayer<TTargetLayer>(int, string)
    HexTerrainLayerGroup<CellEntityLayer>.GetLayer<TTargetLayer>()
    HexTerrainLayerGroup<CellEntityLayer>.GetLayer<TTargetLayer>(HexTerrainLayerReference)
    HexTerrainLayerGroup<CellEntityLayer>.SetOrAddLayer(int, CellEntityLayer, bool, bool)
    HexTerrainLayerGroup<CellEntityLayer>.SetLayer(int, CellEntityLayer, bool, bool)
    HexTerrainLayerGroup<CellEntityLayer>.AddLayer(CellEntityLayer)
    HexTerrainLayerGroup<CellEntityLayer>.RemoveLayer(int, bool)
    HexTerrainLayerGroup<CellEntityLayer>.RemoveLayer(string, bool)
    HexTerrainLayerGroup<CellEntityLayer>.RemoveLayer(CellEntityLayer, bool)
    HexTerrainLayerGroup<CellEntityLayer>.RegisterLayer(CellEntityLayer, int)
    HexTerrainLayerGroup<CellEntityLayer>.UnregisterLayer(CellEntityLayer, int)
    HexTerrainLayerGroup<CellEntityLayer>.SetAllDirty(bool)
    HexTerrainLayerGroup<CellEntityLayer>.Cleanup()
    HexTerrainLayerGroup<CellEntityLayer>.CleanupAsync(JobHandle)
    HexTerrainLayerGroup<CellEntityLayer>.Dispose()
    HexTerrainLayerGroup<CellEntityLayer>.SerializeLayer(BinaryWriter)
    HexTerrainLayerGroup<CellEntityLayer>.DeserializeLayer(BinaryReader, HexTerrainSettings)
    HexTerrainLayer.Name
    HexTerrainLayer.Settings
    HexTerrainLayer.ParentLayer
    HexTerrainLayer.Init<TInitArgs>(HexTerrainSettings, TInitArgs)
    HexTerrainLayer.Resize(int2)
    HexTerrainLayer.InitColoredDataLayer<TValue>(ColorMapCellValueDataLayer<TValue>, IInitColorMapCellValueDataLayerArgs<TValue>)
    HexTerrainLayer.InitDataLayer<TValue>(CellValueDataLayer<TValue>, IInitCellValueDataLayerArgs<TValue>)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(int)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(string)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(int, string)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(HexTerrainLayerReference)
    HexTerrainLayer.CompleteAllJobs()
    HexTerrainLayer.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Fwt.HexTerrains.CellEntities.Data
    Assembly: fwt.hexterrains.dll
    Syntax
    public class CellEntityLayerGroup : HexTerrainLayerGroup<CellEntityLayer>, IDisposable, ISerializableTerrainLayer, IComponentData, IQueryTypeParameter
    Remarks

    This class coordinates multiple cell entity layers and facilitates their initialization, configuration, and entity update operations. It is typically used in scenarios where terrain cells are represented as entities and require batch processing or coordinated updates. Thread safety depends on the usage context and the underlying systems managing the layers.

    Fields

    _allCellEntityConfigs

    Represents the collection of all cell entity configurations available to the cell entity layers.

    Declaration
    protected NativeArray<CellEntityStateConfig> _allCellEntityConfigs
    Field Value
    Type Description
    NativeArray<CellEntityStateConfig>

    Properties

    EntityManager

    Entity manager used for managing entity lifecycle within the cell entity layers.

    Declaration
    public EntityManager EntityManager { get; set; }
    Property Value
    Type Description
    EntityManager

    Methods

    CalculateEntities(JobHandle)

    Schedules entity calculation jobs for all layers and returns a handle that represents their combined dependencies.

    Declaration
    public virtual JobHandle CalculateEntities(JobHandle dependency)
    Parameters
    Type Name Description
    JobHandle dependency

    A job handle representing the dependency that must be completed before entity calculation jobs are scheduled.

    Returns
    Type Description
    JobHandle

    A job handle that represents the combined dependencies of all scheduled entity calculation jobs and the specified dependency. If there are no layers, returns the original dependency.

    Remarks

    This method iterates through all layers, scheduling their entity calculation jobs and combining their dependencies. If a layer is null, it is skipped. The returned job handle can be used to ensure that all entity calculations are complete before proceeding.

    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 CellEntityLayer CreateTerrainLayer<TInitArgs>(TInitArgs initArgs)
    Parameters
    Type Name Description
    TInitArgs initArgs

    Initialization arguments for creating a layer

    Returns
    Type Description
    CellEntityLayer

    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
    HexTerrainLayerGroup<CellEntityLayer>.CreateTerrainLayer<TInitArgs>(TInitArgs)

    InitTerrainLayer<TInitArgs>(CellEntityLayer, HexTerrainSettings, TInitArgs)

    Initializes the specified terrain cell entity layer using the provided settings and initialization arguments.

    Declaration
    public override void InitTerrainLayer<TInitArgs>(CellEntityLayer layer, HexTerrainSettings settings, TInitArgs initArgs)
    Parameters
    Type Name Description
    CellEntityLayer layer

    The cell entity layer to initialize. Must not be null.

    HexTerrainSettings settings

    The terrain settings to apply during initialization.

    TInitArgs initArgs

    The initialization arguments used to configure the layer. Must be compatible with the expected argument type for the layer.

    Type Parameters
    Name Description
    TInitArgs

    The type of the initialization arguments used to configure the terrain layer.

    Overrides
    HexTerrainLayerGroup<CellEntityLayer>.InitTerrainLayer<TInitArgs>(CellEntityLayer, HexTerrainSettings, TInitArgs)
    Remarks

    If the initialization arguments are of type CreateCellEntityLayerRequest, the method sets up the layer with the current entity manager and configuration. Otherwise, the base implementation is called. The method does not throw an exception if the arguments are not compatible, but delegates to the base method.

    Init<TInitLayerArgs>(HexTerrainSettings, IEnumerable<TInitLayerArgs>, NativeArray<CellEntityStateConfig>, EntityManager)

    Declaration
    public virtual void Init<TInitLayerArgs>(HexTerrainSettings settings, IEnumerable<TInitLayerArgs> initLayerArgs, NativeArray<CellEntityStateConfig> cellEntityConfigs, EntityManager entityManager)
    Parameters
    Type Name Description
    HexTerrainSettings settings
    IEnumerable<TInitLayerArgs> initLayerArgs
    NativeArray<CellEntityStateConfig> cellEntityConfigs
    EntityManager entityManager
    Type Parameters
    Name Description
    TInitLayerArgs

    UpdateEntities(Entity, JobHandle)

    Updates all entities in the collection of layers using the specified root entity and job dependency handle.

    Declaration
    public virtual JobHandle UpdateEntities(Entity layerEntity, JobHandle dependency)
    Parameters
    Type Name Description
    Entity layerEntity

    The root entity to be used when updating each layer. This entity is typically passed to each layer's update operation.

    JobHandle dependency

    A job handle representing the dependency that must be completed before the update operations begin. This handle is combined with the handles returned by each layer's update.

    Returns
    Type Description
    JobHandle

    A job handle that represents the combined dependencies of all update operations performed on the layers. If there are no layers, returns the original dependency handle.

    Remarks

    If the collection of layers is null or empty, no update operations are performed and the input dependency is returned unchanged. The returned job handle can be used to ensure that all layer updates have completed before proceeding.

    Implements

    IDisposable
    ISerializableTerrainLayer
    Unity.Entities.IComponentData
    Unity.Entities.IQueryTypeParameter

    Extension Methods

    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    In this article
    Back to top Generated by DocFX