Syntriax.Engine/Engine.Core/Abstract/Assignable/IAssignableGameObject.cs

27 lines
978 B
C#

namespace Syntriax.Engine.Core.Abstract;
/// <summary>
/// Indicates the object is an <see cref="IAssignable"/> with an assignable <see cref="IGameObject"/> field.
/// </summary>
public interface IAssignableGameObject : IAssignable
{
/// <summary>
/// Event triggered when the <see cref="IGameObject"/> value has has been assigned a new value.
/// </summary>
event OnGameObjectAssignedDelegate? OnGameObjectAssigned;
/// <inheritdoc cref="IGameObject" />
IGameObject GameObject { get; }
/// <summary>
/// Assign a value to the <see cref="IGameObject"/> field of this object.
/// </summary>
/// <param name="gameObject">New <see cref="IGameObject"/> to assign.</param>
/// <returns>
/// <see cref="true"/>, if the value given assigned successfully assigned, <see cref="false"/> if not.
/// </returns>
bool Assign(IGameObject gameObject);
delegate void OnGameObjectAssignedDelegate(IAssignableGameObject sender);
}