Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class HashSetDataLayer<TItem>

    Base class for all data layers that use HashSet as a data structure.

    Inheritance
    object
    DataLayer
    HashSetDataLayer<TItem>
    Implements
    IDisposable
    ICommitChanges
    Inherited Members
    DataLayer.IsDisposableItems
    DataLayer._readJobsDependency
    DataLayer.ReadDependency
    DataLayer._writeJobsDependency
    DataLayer.WriteDependency
    DataLayer.CombinedDependency
    DataLayer._isDirty
    DataLayer.IsDirty
    DataLayer._version
    DataLayer.Version
    DataLayer.AddReadDependency(JobHandle)
    DataLayer.AddWriteDependency(JobHandle)
    DataLayer.SetReadDependency(JobHandle)
    DataLayer.SetWriteDependency(JobHandle)
    DataLayer.PrepareToWrite()
    DataLayer.PrepareToRead()
    DataLayer.OpenToRead()
    DataLayer.OpenToWrite()
    DataLayer.CompleteReadJobs()
    DataLayer.CompleteWriteJobs()
    DataLayer.CompleteAllJobs()
    DataLayer.CommitChanges()
    DataLayer.SetDirty(bool)
    DataLayer.Dispose()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Fwt.Core.DataLayers
    Assembly: fwt.core.dll
    Syntax
    public abstract class HashSetDataLayer<TItem> : DataLayer, IDisposable, ICommitChanges where TItem : IEquatable<TItem>
    Type Parameters
    Name Description
    TItem

    Fields

    _data

    Declaration
    protected HashSet<TItem> _data
    Field Value
    Type Description
    HashSet<TItem>

    Properties

    Data

    Container for the data of the layer

    Declaration
    public HashSet<TItem> Data { get; }
    Property Value
    Type Description
    HashSet<TItem>

    Length

    Returns the number of items in the layer.

    Declaration
    public override int Length { get; }
    Property Value
    Type Description
    int
    Overrides
    DataLayer.Length

    Methods

    Add(TItem)

    Adds data to the underlying hash set

    Declaration
    public virtual bool Add(TItem value)
    Parameters
    Type Name Description
    TItem value

    value to add

    Returns
    Type Description
    bool

    true if data was added

    Contains(TItem)

    Checks if the underlying hash set contains the value

    Declaration
    public virtual bool Contains(TItem value)
    Parameters
    Type Name Description
    TItem value

    value to check if layer contains

    Returns
    Type Description
    bool

    true if data is in the layer, otherwise - false

    DisposeAllItems()

    Disposes all items in the underlying hash set by calling DisposeDataItem() method for each item DisposeDataItem(TItem)

    Declaration
    public override void DisposeAllItems()
    Overrides
    DataLayer.DisposeAllItems()

    DisposeDataItem(TItem)

    Disposes provided item if it is IDisposable.

    Declaration
    protected virtual void DisposeDataItem(TItem item)
    Parameters
    Type Name Description
    TItem item

    item to dispose

    Init(int, Allocator)

    Initializes/Reinitializes the data layer with a given size.

    Declaration
    public virtual void Init(int layerSize, Allocator allocator = Allocator.Persistent)
    Parameters
    Type Name Description
    int layerSize

    size of the data layer (cells count)

    Allocator allocator

    allocator to create internal collections. Used in classes inherited from this data layer

    Remove(TItem)

    Removes data from the underlying hash set

    Declaration
    public virtual bool Remove(TItem value)
    Parameters
    Type Name Description
    TItem value

    value to remove from layer

    Returns
    Type Description
    bool

    true if data was in the data layer

    SafeAdd(TItem)

    Checks if the underlying hash set is not null. If hash set is not null, adds the value by calling Add() method Add(TItem).

    Declaration
    public virtual bool SafeAdd(TItem value)
    Parameters
    Type Name Description
    TItem value

    value to add into the underlying hash set

    Returns
    Type Description
    bool

    true if data was added

    SafeContains(TItem)

    Checks if the underlying hash set is not null. If hash set is not null, checks if it contains the value by calling Contains() method Contains(TItem).

    Declaration
    public virtual bool SafeContains(TItem value)
    Parameters
    Type Name Description
    TItem value

    value to check if it is present in the underlying hash set

    Returns
    Type Description
    bool

    true if data is in the hash set, otherwise - false

    SafeRemove(TItem)

    Checks if the underlying hash set is not null. If hash set is not null, removes the value by calling Remove() method Remove(TItem).

    Declaration
    public virtual bool SafeRemove(TItem value)
    Parameters
    Type Name Description
    TItem value

    value to remove from underlying hash set

    Returns
    Type Description
    bool

    true if data was in a data layer

    Implements

    IDisposable
    ICommitChanges

    Extension Methods

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