Cataclysm Core Mono Library (CCML) Documentation

Cataclysm.Entity

Cataclysm.Entity
CCML/Source/Cataclysm/ECS/Entity.cs

public class Entity : IEquatable<Entity>
PropertyDescription
bool Enabled
readonly ulong IDThe entity’s universal unique identifier represented as an unsigned long.
Vec3 RotationLocal rotation in Euler angles.
Vec3 ScaleLocal scale.
Transform TransformThe entity’s transform component.
Vec3 TranslationLocal translation in Euclidean space.
MethodDescription
T AddComponent<T>() where T : ComponentAdds a component of type ‘T’, if it does not already exist, and returns it.
T As<T>() where T : Entity
bool Equals(Entity other)
T GetComponent<T>() where T : ComponentReturns the component of type ‘T’, if it exists.
Entity GetParent()Returns the entity’s parent, if it exists.
bool HasComponent<T>() where T : Component
void Log()Logs the entity’s ID to the console.
void RemoveComponent<T>() where T : ComponentRemoves the component of type ‘T’, if it exists.
void SetParent(Entity parent)Sets the entity’s parent to the given entity.
void Rotate(Vec3 rotation)Adds the given rotation to the entity’s rotation.
void Translate(Vec3 translation)Adds the given translation to the entity’s translation.
override bool Equals(object obj)
override int GetHashCode()
override string ToString()Returns the entity’s ID as a string.
abstract void OnCollisionEnter2D(Entity other)
abstract void OnCollisionExit2D(Entity other)
abstract void OnCreate()Called when the scene starts.
abstract void OnTriggerEnter2D(Entity other)
abstract void OnTriggerExit2D(Entity other)
abstract void OnUpdate(float ts)Called once every frame.
static void Destroy(Entity entity)Destroys the given entity.
static Entity FindEntityByName(string name)
static Entity Instantiate(string name)Instantiates an empty entity.
static Entity Instantiate(Entity parent, string name)Instantiates an empty entity and sets its parent to the given entity.
static operator ==(Entity entity1, Entity entity2)
static operator !=(Entity entity1, Entity entity2)
static implicit operator ulong(Entity e)
static implicit operator Entity(ulong id)