Extensions

Namespace: Bang.Entities
Assembly: Bang.dll

public static class Extensions

Quality of life extensions for the default components declared in Bang.

⭐ Methods

HasInteractive(Entity)

public bool HasInteractive(Entity e)

Checks whether this entity possesses a component of type IInteractiveComponent or not.

Parameters
e Entity

Returns
bool

HasStateMachine(Entity)

public bool HasStateMachine(Entity e)

Checks whether this entity possesses a component of type IStateMachineComponent or not.

Parameters
e Entity

Returns
bool

HasTransform(Entity)

public bool HasTransform(Entity e)

Checks whether this entity possesses a component of type ITransformComponent or not.

Parameters
e Entity

Returns
bool

RemoveInteractive(Entity)

public bool RemoveInteractive(Entity e)

Removes the component of type IInteractiveComponent.

Parameters
e Entity

Returns
bool

RemoveStateMachine(Entity)

public bool RemoveStateMachine(Entity e)

Removes the component of type IStateMachineComponent.

Parameters
e Entity

Returns
bool

RemoveTransform(Entity)

public bool RemoveTransform(Entity e)

Removes the component of type ITransformComponent.

Parameters
e Entity

Returns
bool

WithInteractive(Entity, IInteractiveComponent)

public Entity WithInteractive(Entity e, IInteractiveComponent component)

Adds or replaces the component of type IInteractiveComponent.

Parameters
e Entity
component IInteractiveComponent

Returns
Entity

WithStateMachine(Entity, IStateMachineComponent)

public Entity WithStateMachine(Entity e, IStateMachineComponent component)

Adds or replaces the component of type IStateMachineComponent.

Parameters
e Entity
component IStateMachineComponent

Returns
Entity

WithTransform(Entity, ITransformComponent)

public Entity WithTransform(Entity e, ITransformComponent component)

Adds or replaces the component of type ITransformComponent.

Parameters
e Entity
component ITransformComponent

Returns
Entity

GetInteractive(Entity)

public IInteractiveComponent GetInteractive(Entity e)

Gets a component of type IInteractiveComponent.

Parameters
e Entity

Returns
IInteractiveComponent

TryGetInteractive(Entity)

public IInteractiveComponent TryGetInteractive(Entity e)

Gets a IInteractiveComponent if the entity has one, otherwise returns null.

Parameters
e Entity

Returns
IInteractiveComponent

GetStateMachine(Entity)

public IStateMachineComponent GetStateMachine(Entity e)

Gets a component of type IStateMachineComponent.

Parameters
e Entity

Returns
IStateMachineComponent

TryGetStateMachine(Entity)

public IStateMachineComponent TryGetStateMachine(Entity e)

Gets a IStateMachineComponent if the entity has one, otherwise returns null.

Parameters
e Entity

Returns
IStateMachineComponent

GetTransform(Entity)

public ITransformComponent GetTransform(Entity e)

Gets a component of type ITransformComponent.

Parameters
e Entity

Returns
ITransformComponent

TryGetTransform(Entity)

public ITransformComponent TryGetTransform(Entity e)

Gets a ITransformComponent if the entity has one, otherwise returns null.

Parameters
e Entity

Returns
ITransformComponent

SetInteractive(Entity, IInteractiveComponent)

public void SetInteractive(Entity e, IInteractiveComponent component)

Adds or replaces the component of type IInteractiveComponent.

Parameters
e Entity
component IInteractiveComponent

SetStateMachine(Entity, IStateMachineComponent)

public void SetStateMachine(Entity e, IStateMachineComponent component)

Adds or replaces the component of type IStateMachineComponent.

Parameters
e Entity
component IStateMachineComponent

SetTransform(Entity, ITransformComponent)

public void SetTransform(Entity e, ITransformComponent component)

Adds or replaces the component of type ITransformComponent.

Parameters
e Entity
component ITransformComponent