feat: Added IAssignable.Unassign()

This commit is contained in:
2023-11-24 17:03:21 +03:00
parent 6f68e29fb8
commit 5a01b01215
6 changed files with 79 additions and 2 deletions

View File

@@ -1,6 +1,22 @@
using System;
namespace Syntriax.Engine.Core.Abstract;
/// <summary>
/// Indicates the class implementing it has Assignable fields that are necessary for the engine to work properly.
/// </summary>
public interface IAssignable { }
public interface IAssignable
{
/// <summary>
/// Callback triggered when the <see cref="IAssignable"/>'s fields are unassigned and completely ready to recycle.
/// </summary>
Action<IAssignable>? OnUnassigned { get; set; }
/// <summary>
/// Unassign <see cref="IAssignable"/>'s all fields and make it ready to recycle.
/// </summary>
/// <returns>
/// <see cref="true"/>, if the fields are unsigned successfully, <see cref="false"/> if not.
/// </returns>
bool Unassign();
}