chore: Finalize Don't Set Fields to Null Anymore

This commit is contained in:
2023-11-24 16:37:09 +03:00
parent 44bee2df08
commit 8a8c09f043
6 changed files with 12 additions and 16 deletions

View File

@@ -54,7 +54,7 @@ public abstract class Behaviour : IBehaviour
public bool Assign(IStateEnable stateEnable)
{
if (_initialized)
if (Initialized)
return false;
_stateEnable = stateEnable;
@@ -65,7 +65,7 @@ public abstract class Behaviour : IBehaviour
public bool Assign(IBehaviourController behaviourController)
{
if (_behaviourController is not null)
if (Initialized)
return false;
_behaviourController = behaviourController;
@@ -90,9 +90,6 @@ public abstract class Behaviour : IBehaviour
if (!Initialized)
return false;
_behaviourController = null!;
_stateEnable = null!;
Initialized = false;
return true;
}