Table of Contents

Interface IComponent<TEntity>

Namespace
MonkeyLoader.Components
Assembly
MonkeyLoader.dll

Defines the interface for the components of entities.

public interface IComponent<in TEntity> where TEntity : class, IEntity<in TEntity>

Type Parameters

TEntity

The type of the entity.

Remarks

More specific component interfaces can be created as such:

public interface IConfigKeyComponent<in TKey> : IComponent<TKey>
    where TKey : class, IDefiningConfigKey, IEntity<TKey>
{ }

Methods

Initialize(TEntity)

Initializes this component when it's added to an entity's component list.
This may throw a InvalidOperationException when the state of the given entity is invalid for this component.

void Initialize(TEntity entity)

Parameters

entity TEntity

The entity this component was added to.

Exceptions

InvalidOperationException

When the state of the given entity is invalid.