Show / Hide Table of Contents

    Interface IThingContainer

    Interface for all containers of IThings.

    Inherited Members
    ILocatable.Location
    ILocatable.CarryLocation
    Namespace: Fibula.Common.Contracts.Abstractions
    Assembly: Fibula.Common.Contracts.dll
    Syntax
    public interface IThingContainer : ILocatable

    Methods

    | Improve this Doc View Source

    AddContent(IThingFactory, IThing, Byte)

    Attempts to add a IThing to this container.

    Declaration
    (bool result, IThing remainder) AddContent(IThingFactory thingFactory, IThing thing, byte index = 255)
    Parameters
    Type Name Description
    IThingFactory thingFactory

    A reference to the factory of things to use.

    IThing thing

    The IThing to add to the container.

    System.Byte index

    Optional. The index at which to add the IThing. Defaults to byte.MaxValue, which instructs to add the IThing at any free index.

    Returns
    Type Description
    System.ValueTuple<System.Boolean, IThing>

    A tuple with a value indicating whether the attempt was at least partially successful, and false otherwise. If the result was only partially successful, a remainder of the thing may be returned.

    | Improve this Doc View Source

    FindThingAtIndex(Byte)

    Attempts to find an IThing whitin this container.

    Declaration
    IThing FindThingAtIndex(byte index)
    Parameters
    Type Name Description
    System.Byte index

    The index at which to look for the IThing.

    Returns
    Type Description
    IThing

    The IThing found at the index, if any was found.

    | Improve this Doc View Source

    RemoveContent(IThingFactory, ref IThing, Byte, Byte)

    Attempts to remove a thing from this container.

    Declaration
    (bool result, IThing remainder) RemoveContent(IThingFactory thingFactory, ref IThing thing, byte index = 255, byte amount = 1)
    Parameters
    Type Name Description
    IThingFactory thingFactory

    A reference to the factory of things to use.

    IThing thing

    The IThing to remove from the container.

    System.Byte index

    Optional. The index from which to remove the IThing. Defaults to byte.MaxValue, which instructs to remove the IThing if found at any index.

    System.Byte amount

    Optional. The amount of the thing to remove.

    Returns
    Type Description
    System.ValueTuple<System.Boolean, IThing>

    A tuple with a value indicating whether the attempt was at least partially successful, and false otherwise. If the result was only partially successful, a remainder of the thing may be returned.

    | Improve this Doc View Source

    ReplaceContent(IThingFactory, IThing, IThing, Byte, Byte)

    Attempts to replace a IThing from this container with another.

    Declaration
    (bool result, IThing remainderToChange) ReplaceContent(IThingFactory thingFactory, IThing fromThing, IThing toThing, byte index = 255, byte amount = 1)
    Parameters
    Type Name Description
    IThingFactory thingFactory

    A reference to the factory of things to use.

    IThing fromThing

    The IThing to remove from the container.

    IThing toThing

    The IThing to add to the container.

    System.Byte index

    Optional. The index from which to replace the IThing. Defaults to byte.MaxValue, which instructs to replace the IThing if found at any index.

    System.Byte amount

    Optional. The amount of the fromThing to replace.

    Returns
    Type Description
    System.ValueTuple<System.Boolean, IThing>

    A tuple with a value indicating whether the attempt was at least partially successful, and false otherwise. If the result was only partially successful, a remainder of the thing may be returned.

    Extension Methods

    ContainerExtensions.GetParentContainerHierarchy(IThingContainer, Boolean)
    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2020 | The Fibula Project
    Generated using DocFX | Jose L. Nuñez de Caceres et al.