docs(core): Abstract

This commit is contained in:
2024-02-01 12:14:53 +03:00
parent 4ce9c8e0d9
commit 2f4137dae2
10 changed files with 178 additions and 47 deletions

View File

@@ -2,12 +2,35 @@ using System;
namespace Syntriax.Engine.Core.Abstract;
/// <summary>
/// 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.
/// </summary>
public interface IInitialize
{
/// <summary>
/// Event triggered when the <see cref="Initialize"/> method is called successfully.
/// </summary>
Action<IInitialize>? OnInitialized { get; set; }
/// <summary>
/// Event triggered when the <see cref="Finalize"/> method is called successfully.
/// </summary>
Action<IInitialize>? OnFinalized { get; set; }
/// <summary>
/// The value indicating whether the entity has been initialized.
/// </summary>
bool Initialized { get; }
/// <summary>
/// Initializes the entity.
/// </summary>
/// <returns><see cref="true"/> if initialization is successful, otherwise <see cref="false"/>.</returns>
bool Initialize();
/// <summary>
/// Finalizes the entity so it can either be recycled or garbage collected.
/// </summary>
/// <returns><see cref="true"/> if finalization is successful, otherwise <see cref="false"/>.</returns>
bool Finalize();
}