feat!: GetRequiredBehaviour/HierarchyObject methods added for cleaner null handling

This commit is contained in:
2025-04-13 12:52:27 +03:00
parent bfbcfdce4f
commit 86b8cd9b55
21 changed files with 140 additions and 73 deletions

View File

@@ -1,5 +1,6 @@
using Syntriax.Engine.Core.Abstract;
using Syntriax.Engine.Core.Exceptions;
using Syntriax.Engine.Core.Helpers;
namespace Syntriax.Engine.Core;
@@ -69,9 +70,8 @@ public abstract class BehaviourBase : BaseEntity, IBehaviour
protected override void InitializeInternal()
{
base.InitializeInternal();
NotAssignedException.Check(this, _behaviourController);
NotAssignedException.Check(this, StateEnable);
AssertHelpers.AssertBehaviourControllerAssigned(this);
AssertHelpers.AssertStateEnableAssigned(this);
}
private void OnStateEnabledChanged(IStateEnable sender, bool previousState) => UpdateActive();