refactor!: IGameObject removed

This commit is contained in:
2025-03-28 17:47:05 +03:00
parent d825bb55d3
commit 4ec1a32db2
58 changed files with 937 additions and 1187 deletions

View File

@@ -5,16 +5,16 @@ namespace Syntriax.Engine.Core.Factory;
public class BehaviourControllerFactory
{
public IBehaviourController Instantiate(IGameObject gameObject)
=> Instantiate<BehaviourController>(gameObject);
public IBehaviourController Instantiate(IHierarchyObject hierarchyObject)
=> Instantiate<BehaviourController>(hierarchyObject);
public T Instantiate<T>(IGameObject gameObject, params object?[]? args)
public T Instantiate<T>(IHierarchyObject hierarchyObject, params object?[]? args)
where T : class, IBehaviourController
{
T behaviourController = TypeFactory.Get<T>(args);
if (!behaviourController.Assign(gameObject))
throw AssignException.From(behaviourController, gameObject);
if (!behaviourController.Assign(hierarchyObject))
throw AssignException.From(behaviourController, hierarchyObject);
return behaviourController;
}