chore: Added Initial Engine Code

This commit is contained in:
2023-11-23 22:07:49 +03:00
parent a47586851c
commit 5fcf63c5a7
40 changed files with 1773 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
using Syntriax.Engine.Core.Abstract;
using Syntriax.Engine.Core.Exceptions;
namespace Syntriax.Engine.Core.Factory;
public class StateEnableFactory
{
public IStateEnable Instantiate(IEntity entity) => Instantiate<StateEnable>(entity);
public T Instantiate<T>(IEntity entity, params object?[]? args) where T : class, IStateEnable
{
T stateEnable = TypeFactory.Get<T>(args);
if (!stateEnable.Assign(entity))
throw AssignException.From(stateEnable, entity);
return stateEnable;
}
}