IEntity

Namespace: Murder.Prefabs
Assembly: Murder.dll

public abstract IEntity

⭐ Properties

Children

public abstract virtual ImmutableArray<T> Children { get; }

Returns all the identifiers for this entity children.

Returns
ImmutableArray<T>

Components

public abstract virtual ImmutableArray<T> Components { get; }

Returns all the components of the entity asset, followed by all the components of the instance.

Returns
ImmutableArray<T>

Guid

public abstract virtual Guid Guid { get; }

Returns
Guid

Name

public abstract virtual string Name { get; }

Returns
string

PrefabRefName

public abstract virtual string PrefabRefName { get; }

If this has a prefab reference, this will return its name. Otherwise, return null.

Returns
string

⭐ Methods

AddOrReplaceComponentForChild(Guid, IComponent)

public abstract bool AddOrReplaceComponentForChild(Guid childGuid, IComponent component)

Parameters
childGuid Guid
component IComponent

Returns
bool

CanRemoveChild(Guid)

public abstract bool CanRemoveChild(Guid instanceGuid)

Parameters
instanceGuid Guid

Returns
bool

CanRevertComponent(Type)

public abstract bool CanRevertComponent(Type type)

Parameters
type Type

Returns
bool

HasComponent(Type)

public abstract bool HasComponent(Type type)

Parameters
type Type

Returns
bool

HasComponentAtChild(Guid, Type)

public abstract bool HasComponentAtChild(Guid childGuid, Type type)

Parameters
childGuid Guid
type Type

Returns
bool

RemoveChild(Guid)

public abstract bool RemoveChild(Guid guid)

Parameters
guid Guid

Returns
bool

RemoveComponent(Type)

public abstract bool RemoveComponent(Type t)

Parameters
t Type

Returns
bool

RevertComponent(Type)

public abstract bool RevertComponent(Type t)

Parameters
t Type

Returns
bool

RevertComponentForChild(Guid, Type)

public abstract bool RevertComponentForChild(Guid childGuid, Type t)

Parameters
childGuid Guid
t Type

Returns
bool

TryGetChild(Guid, out EntityInstance&)

public abstract bool TryGetChild(Guid guid, EntityInstance& instance)

Parameters
guid Guid
instance EntityInstance&

Returns
bool

GetComponent(Type)

public abstract IComponent GetComponent(Type componentType)

Parameters
componentType Type

Returns
IComponent

TryGetComponentForChild(Guid, Type)

public abstract IComponent TryGetComponentForChild(Guid guid, Type t)

Parameters
guid Guid
t Type

Returns
IComponent

FetchChildren()

public abstract ImmutableArray<T> FetchChildren()

INTERNAL ONLY Fetches the actual entities for all children.

Returns
ImmutableArray<T>

GetChildComponents(Guid)

public abstract ImmutableArray<T> GetChildComponents(Guid guid)

Parameters
guid Guid

Returns
ImmutableArray<T>

Create(World)

public abstract int Create(World world)

Create the entity in the world!

Parameters
world World

Returns
int

AddChild(EntityInstance)

public abstract void AddChild(EntityInstance asset)

Parameters
asset EntityInstance

AddOrReplaceComponent(IComponent)

public abstract void AddOrReplaceComponent(IComponent c)

Parameters
c IComponent

RemoveComponentForChild(Guid, Type)

public abstract void RemoveComponentForChild(Guid childGuid, Type t)

Parameters
childGuid Guid
t Type

SetName(string)

public abstract void SetName(string name)

Parameters
name string

GetComponent()

public virtual T GetComponent()

Returns
T