Table of Contents

Class Entity

Represents a game object in the Entity-Component-System (ECS) pattern. An entity is nothing more than a container of Component instances — it has no logic itself. Behaviour is provided by systems that query entities for required components.

public class Entity
Inheritance
Entity
Inherited Members

Methods

AddComponent<T>(T)

Adds (or replaces) a component of type T on this entity.

public void AddComponent<T>(T component) where T : Component

Parameters

component T

The component data to attach.

Type Parameters

T

The component type.

GetComponent<T>()

Returns the component of type T attached to this entity, or null if not present.

public T GetComponent<T>() where T : Component

Returns

T

Type Parameters

T

The component type to retrieve.

HasComponent<T>()

Returns true if this entity has a component of type T.

public bool HasComponent<T>() where T : Component

Returns

bool

Type Parameters

T