Interface IThingContainer
Interface for all containers of IThings.
Namespace: Fibula.Common.Contracts.Abstractions
Assembly: Fibula.Common.Contracts.dll
Syntax
public interface IThingContainer : ILocatable
Methods
| Improve this Doc View SourceAddContent(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. |
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. |
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 |
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. |
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 |
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. |