Click or drag to resize
EntityManagerAddComponent Method (Int32, IEntityComponent)
Attaches the passed component to the entity with the specified id.

Namespace: Slash.ECS.Components
Assembly: Slash.ECS (in Slash.ECS.dll) Version: 1.0.6018.40178
Syntax
public void AddComponent(
	int entityId,
	IEntityComponent component
)

Parameters

entityId
Type: SystemInt32
Id of the entity to attach the component to.
component
Type: Slash.ECS.ComponentsIEntityComponent
Component to attach.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionEntity id is negative.
ArgumentOutOfRangeExceptionEntity id has not yet been assigned.
ArgumentExceptionEntity with the specified id has already been removed.
ArgumentNullExceptionPassed component is null.
InvalidOperationExceptionThere is already a component of the same type attached.
See Also