namespace Syntriax.Engine.Core.Abstract; /// /// Represents an entity that can be initialized and finalized. This information is useful for objects we know that are not in use and can be either recycled or dropped for garbage collection. /// public interface IInitialize { /// /// Event triggered when the method is called successfully. /// event OnInitializedDelegate? OnInitialized; /// /// Event triggered when the method is called successfully. /// event OnFinalizedDelegate? OnFinalized; /// /// The value indicating whether the entity has been initialized. /// bool Initialized { get; } /// /// Initializes the entity. /// /// if initialization is successful, otherwise . bool Initialize(); /// /// Finalizes the entity so it can either be recycled or garbage collected. /// /// if finalization is successful, otherwise . bool Finalize(); delegate void OnInitializedDelegate(IInitialize sender); delegate void OnFinalizedDelegate(IInitialize sender); }