Click or drag to resize
EntityManagerGetComponent Method (Int32, Type, Boolean)
Gets a component of the passed type attached 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 IEntityComponent GetComponent(
	int entityId,
	Type componentType,
	bool considerInherited = false
)

Parameters

entityId
Type: SystemInt32
Id of the entity to get the component of.
componentType
Type: SystemType
Type of the component to get.
considerInherited (Optional)
Type: SystemBoolean
Indicates if a component that was inherited by the specified type should be returned if found.

Return Value

Type: IEntityComponent
The component, if there is one of the specified type attached to the entity, and null otherwise.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionEntity id is negative.
ArgumentOutOfRangeExceptionEntity id has not yet been assigned.
ArgumentExceptionEntity with the specified id has already been removed.
ArgumentNullExceptionPassed component type is null.
See Also