Class Actor
Represents a component which provides the data and functionality of an actor.
public class Actor : WorldEntity
- Inheritance
-
Actor
- Inherited Members
Constructors
Actor(IActorsComponent, IActor)
Initializes a new instance of the Actor class.
protected Actor(IActorsComponent actors, IActor actor)
Parameters
actorsIActorsComponentactorIActor
Properties
Angle
Gets or sets the facing angle of this actor.
public virtual float Angle { get; set; }
Property Value
Health
Gets or sets the health of this actor.
public virtual float Health { get; set; }
Property Value
IsInvulnerable
Gets or sets a value indicating whether this actor is invulnerable.
public virtual bool IsInvulnerable { get; set; }
Property Value
IsOmpEntityDestroyed
Gets a value indicating whether the open.mp entity counterpart has been destroyed.
protected bool IsOmpEntityDestroyed { get; }
Property Value
Skin
Gets or sets the skin of this actor.
public virtual int Skin { get; set; }
Property Value
Methods
ApplyAnimation(string, string, float, bool, bool, bool, bool, int)
Applies the specified animation to this actor.
[Obsolete("Use the TimeSpan overload. This int-milliseconds variant is kept for source compatibility and will be removed.")]
public virtual void ApplyAnimation(string library, string name, float fDelta, bool loop, bool lockX, bool lockY, bool freeze, int time)
Parameters
librarystringThe animation library from which to apply an animation.
namestringThe name of the animation to apply within the specified
library.fDeltafloatThe speed at which to play the animation.
loopboolA value indicating whether the animation should loop.
lockXboolA value indicating whether to allow this actor to move along its x-coordinate.
lockYboolA value indicating whether to allow this actor to move along its y-coordinate.
freezeboolA value indicating whether to freeze this actor at the end of the animation.
timeintThe duration for which to play the animation.
Exceptions
- ArgumentNullException
Thrown if
libraryornameis null.
ApplyAnimation(string, string, float, bool, bool, bool, bool, TimeSpan)
Applies the specified animation to this actor.
public virtual void ApplyAnimation(string library, string name, float fDelta, bool loop, bool lockX, bool lockY, bool freeze, TimeSpan time)
Parameters
librarystringThe animation library from which to apply an animation.
namestringThe name of the animation to apply within the specified
library.fDeltafloatThe speed at which to play the animation.
loopboolA value indicating whether the animation should loop.
lockXboolA value indicating whether to allow this actor to move along its x-coordinate.
lockYboolA value indicating whether to allow this actor to move along its y-coordinate.
freezeboolA value indicating whether to freeze this actor at the end of the animation.
timeTimeSpanThe duration for which to play the animation.
Exceptions
- ArgumentNullException
Thrown if
libraryornameis null.
ClearAnimations()
Clears all animations applied to this actor.
public virtual void ClearAnimations()
IsStreamedIn(Player)
Determines whether this actor is streamed in for the specified player.
public virtual bool IsStreamedIn(Player player)
Parameters
Returns
OnDestroyComponent()
This method is invoked before this component is destroyed and removed from its entity.
protected override void OnDestroyComponent()
ToString()
public override string ToString()
Returns
Operators
implicit operator IActor(Actor?)
public static implicit operator IActor(Actor? actor)
Parameters
actorActor