Search Results for

    Show / Hide Table of Contents

    Class SheetBase<T>

    Inheritance
    object
    SheetBase<T>
    LocalizationSheetBase<TValue, TRef>
    Sheet<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.Sheets
    Assembly: Glitch9.AIDevKit.Sheets.dll
    Syntax
    public abstract class SheetBase<T>
    Type Parameters
    Name Description
    T

    Constructors

    | Edit this page View Source

    SheetBase(ITableSource)

    Declaration
    protected SheetBase(ITableSource source)
    Parameters
    Type Name Description
    ITableSource source

    Fields

    | Edit this page View Source

    m_Source

    Declaration
    protected readonly ITableSource m_Source
    Field Value
    Type Description
    ITableSource

    Properties

    | Edit this page View Source

    Count

    Gets the number of rows currently loaded in the sheet.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    IsLoaded

    Gets whether the sheet has been successfully loaded.

    Declaration
    public bool IsLoaded { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Map

    Returns a read-only view of the cached map. Valid only after LoadAsync().

    Declaration
    public abstract IReadOnlyDictionary<string, T> Map { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, T>

    Methods

    | Edit this page View Source

    GetRequired(string)

    Retrieves the value associated with the specified key. Throws an exception if the key is not found.

    Declaration
    public T GetRequired(string key)
    Parameters
    Type Name Description
    string key

    The unique identifier for the value.

    Returns
    Type Description
    T

    The value associated with the specified key.

    Exceptions
    Type Condition
    ArgumentException

    Thrown when the key is null or empty.

    KeyNotFoundException

    Thrown when the key is not found in the sheet.

    | Edit this page View Source

    LoadAsync(bool, CancellationToken)

    Asynchronously loads all rows from the source and builds the sheet. The loadAllObjectReferences option can be ignored if the model is a ScriptableObject, as ScriptableObject holds references directly. Use loadAllObjectReferences when the model is a pure C# class and contains UnityEngine.Object references.

    Declaration
    public UniTask LoadAsync(bool loadAllObjectReferences, CancellationToken ct = default)
    Parameters
    Type Name Description
    bool loadAllObjectReferences

    Whether to load all Unity object references recursively.

    CancellationToken ct

    Cancellation token to abort the operation.

    Returns
    Type Description
    UniTask
    | Edit this page View Source

    LoadAsync(CancellationToken)

    Asynchronously loads all rows from the source and builds the sheet.

    Declaration
    public UniTask LoadAsync(CancellationToken ct = default)
    Parameters
    Type Name Description
    CancellationToken ct

    Cancellation token to abort the operation.

    Returns
    Type Description
    UniTask
    | Edit this page View Source

    LoadAsyncInternal(bool, CancellationToken)

    Declaration
    protected abstract UniTask LoadAsyncInternal(bool loadAllObjectReferences, CancellationToken ct)
    Parameters
    Type Name Description
    bool loadAllObjectReferences
    CancellationToken ct
    Returns
    Type Description
    UniTask
    | Edit this page View Source

    TryGet(string, out T)

    Attempts to retrieve the value associated with the specified key.

    Declaration
    public bool TryGet(string key, out T value)
    Parameters
    Type Name Description
    string key

    The unique identifier for the value.

    T value

    When this method returns, contains the value associated with the key, if found; otherwise, null.

    Returns
    Type Description
    bool

    True if the key was found; otherwise, false.

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation