Class CollectionWrapper<T>
Represents an abstract collection of items. The items are stored internally as List. Implement your own concrete collections by inheriting from this class.
Inherited Members
Namespace: Unity.Tutorials.Core.Editor
Syntax
public abstract class CollectionWrapper<T> : CollectionWrapper, IEnumerable<T>, IEnumerable
Type Parameters
Name | Description |
---|---|
T | The type of elements in the collection. |
Constructors
CollectionWrapper()
Default-constructs an empty collection.
Declaration
public CollectionWrapper()
CollectionWrapper(IList<T>)
Constructs with items.
Declaration
public CollectionWrapper(IList<T> items)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | items |
Properties
Count
The count of items.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Item[Int32]
Returns an item at a specific index.
Declaration
public T this[int i] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | i |
Property Value
Type | Description |
---|---|
T |
Methods
AddItem(T)
Adds an item to the collection
Declaration
public void AddItem(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
GetEnumerator()
Returns an Enumerator to the items.
Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<T> |
Implements
GetItems(List<T>)
Returns the items of the collection as a list.
Declaration
public void GetItems(List<T> items)
Parameters
Type | Name | Description |
---|---|---|
List<T> | items |
SetItems(IEnumerable<T>)
Sets the items of the collection.
Declaration
public void SetItems(IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | items |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator | An IEnumerator object that can be used to iterate through the collection. |