BREAKING CHANGE: IEntities are now IInitialize

This commit is contained in:
Syntriax 2023-11-24 17:04:19 +03:00
parent 5a01b01215
commit 251bd948ab
4 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
namespace Syntriax.Engine.Core.Abstract;
public interface IEntity : IAssignableStateEnable
public interface IEntity : IInitialize, IAssignableStateEnable
{
}

View File

@ -2,7 +2,7 @@ using System;
namespace Syntriax.Engine.Core.Abstract;
public interface IInitialize : IEntity
public interface IInitialize
{
Action<IInitialize>? OnInitialized { get; set; }
Action<IInitialize>? OnFinalized { get; set; }

View File

@ -10,7 +10,7 @@ using Syntriax.Engine.Core.Factory;
namespace Syntriax.Engine.Core;
public class GameManager : IInitialize
public class GameManager : IEntity
{
public Action<IInitialize>? OnInitialized { get; set; } = null;
public Action<IInitialize>? OnFinalized { get; set; } = null;

View File

@ -30,7 +30,7 @@ public class StateEnable : IStateEnable
public bool Assign(IEntity entity)
{
if (_entity is not null) // TODO: Add IInitialize to IAssignable or IEntity maybe?
if (_entity.Initialized)
return false;
_entity = entity;