refactor: behaviour factory universe object parameter removed
This commit is contained in:
@@ -4,10 +4,10 @@ namespace Syntriax.Engine.Core.Factory;
|
||||
|
||||
public class BehaviourFactory
|
||||
{
|
||||
public static T Instantiate<T>(IUniverseObject universeObject, params object?[]? args) where T : class, IBehaviour
|
||||
=> Instantiate<T>(universeObject, stateEnable: null, args);
|
||||
public static T Instantiate<T>(params object?[]? args) where T : class, IBehaviour
|
||||
=> Instantiate<T>(stateEnable: null, args);
|
||||
|
||||
public static T Instantiate<T>(IUniverseObject universeObject, IStateEnable? stateEnable, params object?[]? args)
|
||||
public static T Instantiate<T>(IStateEnable? stateEnable, params object?[]? args)
|
||||
where T : class, IBehaviour
|
||||
{
|
||||
T behaviour = TypeFactory.Get<T>(args);
|
||||
@@ -18,8 +18,6 @@ public class BehaviourFactory
|
||||
|
||||
if (!behaviour.Assign(stateEnable))
|
||||
throw AssignFailedException.From(behaviour, stateEnable);
|
||||
if (!behaviour.Assign(universeObject.BehaviourController))
|
||||
throw AssignFailedException.From(behaviour, universeObject.BehaviourController);
|
||||
|
||||
return behaviour;
|
||||
}
|
||||
|
Reference in New Issue
Block a user