using Syntriax.Engine.Core.Abstract; using Syntriax.Engine.Core.Exceptions; namespace Syntriax.Engine.Core.Factory; public class BehaviourControllerFactory { public IBehaviourController Instantiate(IGameObject gameObject) => Instantiate(gameObject); public T Instantiate(IGameObject gameObject, params object?[]? args) where T : class, IBehaviourController { T behaviourController = TypeFactory.Get(args); if (!behaviourController.Assign(gameObject)) throw AssignException.From(behaviourController, gameObject); return behaviourController; } }