Class GameComponentCollection
A collection of IGameComponent instances.
public sealed class GameComponentCollection : Collection<IGameComponent>, IList<IGameComponent>, ICollection<IGameComponent>, IReadOnlyList<IGameComponent>, IReadOnlyCollection<IGameComponent>, IEnumerable<IGameComponent>, IList, ICollection, IEnumerable
- Inheritance
-
GameComponentCollection
- Implements
- Inherited Members
Methods
ClearItems()
Removes every GameComponent from this GameComponentCollection. Triggers OnComponentRemoved(GameComponentCollectionEventArgs) once for each GameComponent removed.
protected override void ClearItems()
InsertItem(int, IGameComponent)
Inserts an element into the Collection<T> at the specified index.
protected override void InsertItem(int index, IGameComponent item)
Parameters
index
intThe zero-based index at which
item
should be inserted.item
IGameComponentThe object to insert. The value can be null for reference types.
Exceptions
- ArgumentOutOfRangeException
index
is less than zero.-or-
index
is greater than Count.
RemoveItem(int)
Removes the element at the specified index of the Collection<T>.
protected override void RemoveItem(int index)
Parameters
index
intThe zero-based index of the element to remove.
Exceptions
- ArgumentOutOfRangeException
index
is less than zero.-or-
index
is equal to or greater than Count.
SetItem(int, IGameComponent)
Replaces the element at the specified index.
protected override void SetItem(int index, IGameComponent item)
Parameters
index
intThe zero-based index of the element to replace.
item
IGameComponentThe new value for the element at the specified index. The value can be null for reference types.
Exceptions
- ArgumentOutOfRangeException
index
is less than zero.-or-
index
is greater than Count.
Events
ComponentAdded
Event that is triggered when a GameComponent is added to this GameComponentCollection.
public event EventHandler<GameComponentCollectionEventArgs> ComponentAdded
Event Type
ComponentRemoved
Event that is triggered when a GameComponent is removed from this GameComponentCollection.
public event EventHandler<GameComponentCollectionEventArgs> ComponentRemoved