diff --git a/src/SampSharp.OpenMp.Entities/Components/Component.cs b/src/SampSharp.OpenMp.Entities/Components/Component.cs index 6e0cf3e2..b0aa2d7e 100644 --- a/src/SampSharp.OpenMp.Entities/Components/Component.cs +++ b/src/SampSharp.OpenMp.Entities/Components/Component.cs @@ -22,7 +22,7 @@ protected internal virtual IEntityManager Manager /// /// Gets the parent entity of the entity to which this component has been attached. /// - public EntityId Parent => Manager.GetParent(Entity); + public virtual EntityId Parent => Manager.GetParent(Entity); /// /// Gets the entity to which this component has been attached. @@ -32,13 +32,13 @@ protected internal virtual IEntityManager Manager /// /// Gets a value indicating whether this component is alive (has not been destroyed). /// - public bool IsComponentAlive { get; private set; } = true; + public virtual bool IsComponentAlive { get; private set; } = true; /// /// Gets a value indicating whether this component is being destroyed. This property is set to when the /// destruction of this component has been initiated. /// - public bool IsDestroying { get; private set; } + public virtual bool IsDestroying { get; private set; } /// /// Gets a component of the specified type attached to the entity. @@ -46,7 +46,7 @@ protected internal virtual IEntityManager Manager /// The type of the component to find. /// The found component or if no component of the specified type could be found. [Pure] - public T? GetComponent() where T : Component + public virtual T? GetComponent() where T : Component { return Manager.GetComponent(Entity); } @@ -58,7 +58,7 @@ protected internal virtual IEntityManager Manager /// The type of the component to add. /// The arguments of the constructor of the component. /// The created component. - public T AddComponent(params object[] args) where T : Component + public virtual T AddComponent(params object[] args) where T : Component { return Manager.AddComponent(Entity, args); } @@ -68,7 +68,7 @@ public T AddComponent(params object[] args) where T : Component /// /// The type of the component to add. /// The created component. - public T AddComponent() where T : Component + public virtual T AddComponent() where T : Component { return Manager.AddComponent(Entity); } @@ -78,7 +78,7 @@ public T AddComponent() where T : Component /// /// The type of the component to add. /// The instance of component to be added. - public void AddComponent(T component) where T : Component + public virtual void AddComponent(T component) where T : Component { ArgumentNullException.ThrowIfNull(component); @@ -90,7 +90,7 @@ public void AddComponent(T component) where T : Component /// entity. /// /// The type of the components to destroy. - public void DestroyComponents() where T : Component + public virtual void DestroyComponents() where T : Component { Manager.Destroy(Entity); } @@ -98,7 +98,7 @@ public void DestroyComponents() where T : Component /// /// Destroys the entity. /// - public void DestroyEntity() + public virtual void DestroyEntity() { Manager.Destroy(Entity); } @@ -106,7 +106,7 @@ public void DestroyEntity() /// /// Destroys this component. /// - public void Destroy() + public virtual void Destroy() { Manager.Destroy(this); } @@ -117,7 +117,7 @@ public void Destroy() /// The type of the components to find. /// A collection of the found components. [Pure] - public T[] GetComponents() where T : Component + public virtual T[] GetComponents() where T : Component { return Manager.GetComponents(Entity); } @@ -129,7 +129,7 @@ public T[] GetComponents() where T : Component /// The type of the component to find. /// The found component or if no component of the specified type could be found. [Pure] - public T? GetComponentInChildren() where T : Component + public virtual T? GetComponentInChildren() where T : Component { return Manager.GetComponentInChildren(Entity); } @@ -141,7 +141,7 @@ public T[] GetComponents() where T : Component /// The type of the components to find. /// A collection of the found components. [Pure] - public T[] GetComponentsInChildren() where T : Component + public virtual T[] GetComponentsInChildren() where T : Component { return Manager.GetComponentsInChildren(Entity); } @@ -153,7 +153,7 @@ public T[] GetComponentsInChildren() where T : Component /// The type of the component to find. /// The found component or if no component of the specified type could be found. [Pure] - public T? GetComponentInParent() where T : Component + public virtual T? GetComponentInParent() where T : Component { return Manager.GetComponentInParent(Entity); } @@ -165,7 +165,7 @@ public T[] GetComponentsInChildren() where T : Component /// The type of the components to find. /// A collection of the found components. [Pure] - public T[] GetComponentsInParent() where T : Component + public virtual T[] GetComponentsInParent() where T : Component { return Manager.GetComponentsInParent(Entity); }