Skip to content

Latest commit

 

History

History
50 lines (43 loc) · 8.26 KB

Entity.md

File metadata and controls

50 lines (43 loc) · 8.26 KB

Entity Struct

Represents an item in the World.
Only use Entity generated from the CreateEntity() method.

public readonly struct Entity :
System.IDisposable,
System.IEquatable<DefaultEcs.Entity>

Implements System.IDisposable, System.IEquatable<Entity>

Properties
IsAlive Gets whether the current Entity is alive or not.
World Gets the World instance from which current Entity originate.
Methods
CopyTo(World) Creates a copy of current Entity with all of its components in the given World.
This method is not thread safe.
CopyTo(World, ComponentCloner) Creates a copy of current Entity with all of its components in the given World using the given ComponentCloner.
This method is not thread safe.
Disable() Disables the current Entity so it does not appear in EntitySet.
This method is not thread safe.
Disable<T>() Disables the current Entity component of type T so it does not appear in EntitySet.
Does nothing if current Entity does not have a component of type T.
This method is not thread safe.
Dispose() Clean the current Entity of all its components.
The current Entity should not be used again after calling this method and IsAlive will return false.
Enable() Enables the current Entity so it can appear in EntitySet.
This method is not thread safe.
Enable<T>() Enables the current Entity component of type T so it can appear in EntitySet.
Does nothing if current Entity does not have a component of type T.
This method is not thread safe.
Equals(Entity) Indicates whether the current object is equal to another object of the same type.
Equals(object) Indicates whether this instance and a specified object are equal.
Get<T>() Gets the component of type T on the current Entity.
GetHashCode() Returns the hash code for this instance.
Has<T>() Returns whether the current Entity has a component of type T.
IsEnabled() Gets whether the current Entity is enabled or not.
IsEnabled<T>() Gets whether the current Entity component of type T is enabled or not.
NotifyChanged<T>() Notifies the value of the component of type T has changed.
This method is not thread safe.
ReadAllComponents(IComponentReader) Calls on reader with all the component of the current Entity.
This method is primiraly used for serialization purpose and should not be called in game logic.
Remove<T>() Removes the component of type T on the current Entity.
This method is not thread safe.
Set<T>() Sets the value of the component of type T to its default value on the current Entity.
This method is not thread safe.
Set<T>(T) Sets the value of the component of type T on the current Entity.
This method is not thread safe.
SetSameAs<T>(Entity) Sets the value of the component of type T on the current Entity to the same instance of an other Entity.
This method is not thread safe.
SetSameAsWorld<T>() Sets the value of the component of type T on the current Entity to the same instance of an other Entity.
This method is not thread safe.
ToString() Returns a string representation of this instance.
Operators
operator ==(Entity, Entity) Determines whether two specified entities are the same.
operator !=(Entity, Entity) Determines whether two specified entities are not the same.