BREAKING CHANGE: renamed original Behaviour class to BehaviourInternal, and replaced it with BehaviourBase

Original Behaviour was using old methods for detecting entering/exiting universe,
they are now all under the same hood and the original is kept for UniverseEntranceManager
because it needs to enter the universe without itself. The internal behaviour kept under
a subnamespace of "Core.Internal" for the purpose that it might come in handy for other use cases.
This commit is contained in:
2025-10-22 16:50:19 +03:00
parent 2f32038f04
commit 988a6f67f2
23 changed files with 194 additions and 185 deletions

View File

@@ -4,7 +4,7 @@ using Engine.Core;
namespace Engine.Integration.MonoGame;
public class LoadContentManager : Behaviour, IFirstFrameUpdate
public class LoadContentManager : Behaviour, IEnterUniverse, IExitUniverse, IFirstFrameUpdate
{
// We use Ascending order because we are using reverse for loop to call them
private static Comparer<int> SortByAscendingPriority() => Comparer<int>.Create((x, y) => x.CompareTo(y));
@@ -20,14 +20,14 @@ public class LoadContentManager : Behaviour, IFirstFrameUpdate
monoGameWindowContainer = Universe.FindRequiredBehaviour<MonoGameWindowContainer>();
}
protected override void OnEnteredUniverse(IUniverse universe)
public void EnterUniverse(IUniverse universe)
{
loadContents.Assign(universe);
universe.OnPreUpdate.AddListener(OnPreUpdate);
}
protected override void OnExitedUniverse(IUniverse universe)
public void ExitUniverse(IUniverse universe)
{
loadContents.Unassign();