EntityServices

Namespace: Murder.Services
Assembly: Murder.dll

public static class EntityServices

⭐ Methods

AnimationAvailable(Entity, string)

public bool AnimationAvailable(Entity entity, string id)

Parameters
entity Entity
id string

Returns
bool

IsChildOf(World, Entity, Entity)

public bool IsChildOf(World world, Entity parent, Entity child)

Parameters
world World
parent Entity
child Entity

Returns
bool

IsInCamera(Entity, World)

public bool IsInCamera(Entity e, World world)

Parameters
e Entity
world World

Returns
bool

FindRootEntity(Entity)

public Entity FindRootEntity(Entity e)

Parameters
e Entity

Returns
Entity

TryFindTarget(Entity, World, string)

public Entity TryFindTarget(Entity entity, World world, string name)

Try to find the target of a GuidToIdTargetCollectionComponent.

Parameters
entity Entity
world World
name string

Returns
Entity

TryFindTarget(Entity, World)

public Entity TryFindTarget(Entity entity, World world)

Try to find the target of a GuidToIdTargetComponent.

Parameters
entity Entity
world World

Returns
Entity

FindAllTargets(Entity, string)

public IEnumerable<T> FindAllTargets(Entity e, string prefix)

Return all targets of entity that start with . This will first check for a target id. If none, it will check for a target collection with .

Parameters
e Entity
prefix string

Returns
IEnumerable<T>

TryActiveSpriteAsset(Entity)

public SpriteAsset TryActiveSpriteAsset(Entity entity)

Parameters
entity Entity

Returns
SpriteAsset

TryGetEntityName(Entity)

public string TryGetEntityName(Entity entity)

Parameters
entity Entity

Returns
string

PlayAsepriteAnimationNext(Entity, string)

public T? PlayAsepriteAnimationNext(Entity entity, string animationName)

Parameters
entity Entity
animationName string

Returns
T?

PlaySpriteAnimation(Entity, ImmutableArray)

public T? PlaySpriteAnimation(Entity entity, ImmutableArray<T> animations)

Plays an animation or animation sequence. Loops the last animation.

Parameters
entity Entity

animations ImmutableArray<T>

Returns
T?

PlaySpriteAnimation(Entity, String[])

public T? PlaySpriteAnimation(Entity entity, String[] nextAnimations)

Plays an animation or animation sequence. Loops the last animation.

Parameters
entity Entity

nextAnimations string[]

Returns
T?

PlaySpriteAnimationOnce(Entity, string)

public T? PlaySpriteAnimationOnce(Entity entity, string animation)

Plays an animation or animation sequence. Do not loop.

Parameters
entity Entity

animation string

Returns
T?

TryPlayAsepriteAnimationNext(Entity, string)

public T? TryPlayAsepriteAnimationNext(Entity entity, string animationName)

Parameters
entity Entity
animationName string

Returns
T?

TryPlaySpriteAnimation(Entity, ImmutableArray)

public T? TryPlaySpriteAnimation(Entity entity, ImmutableArray<T> nextAnimations)

Parameters
entity Entity
nextAnimations ImmutableArray<T>

Returns
T?

TryPlaySpriteAnimation(Entity, String[])

public T? TryPlaySpriteAnimation(Entity entity, String[] nextAnimations)

Parameters
entity Entity
nextAnimations string[]

Returns
T?

RemoveSpeedMultiplier(Entity, int)

public void RemoveSpeedMultiplier(Entity entity, int slot)

Parameters
entity Entity
slot int

RotateChildPositions(World, Entity, float)

public void RotateChildPositions(World world, Entity entity, float angle)

Parameters
world World
entity Entity
angle float

RotatePosition(Entity, float)

public void RotatePosition(Entity entity, float angle)

Parameters
entity Entity
angle float

RotatePositionAround(Entity, Vector2, float)

public void RotatePositionAround(Entity entity, Vector2 center, float angle)

Parameters
entity Entity
center Vector2
angle float

SetAgentSpeedMultiplier(Entity, int, float)

public void SetAgentSpeedMultiplier(Entity entity, int slot, float speedMultiplier)

Parameters
entity Entity
slot int
speedMultiplier float

Spawn(World, Vector2, Guid, int, float, IComponent[])

public void Spawn(World world, Vector2 spawnerPosition, Guid entityToSpawn, int count, float radius, IComponent[] addComponents)

Parameters
world World
spawnerPosition Vector2
entityToSpawn Guid
count int
radius float
addComponents IComponent[]

SubscribeToAnimationEvents(Entity, Entity)

public void SubscribeToAnimationEvents(Entity listener, Entity broadcaster)

Parameters
listener Entity
broadcaster Entity