chore: updated engine with non-universe-object managers

This commit is contained in:
2025-06-04 00:03:26 +03:00
parent 29df4a36e9
commit 4710b8364c
10 changed files with 40 additions and 40 deletions

View File

@@ -10,7 +10,7 @@ namespace Syntriax.Engine.Network;
/// <summary>
/// Intermediary manager that looks up in it's hierarchy for a <see cref="INetworkCommunicator"/> to route/broadcast it's received packets to their destinations.
/// </summary>
public class NetworkManager : UniverseObject, INetworkManager
public class NetworkManager : Behaviour, INetworkManager
{
private readonly Dictionary<Type, Dictionary<Type, List<MethodInfo>>> clientPacketArrivalMethods = [];
private readonly Dictionary<Type, Dictionary<Type, List<MethodInfo>>> serverPacketArrivalMethods = [];
@@ -231,11 +231,11 @@ public class NetworkManager : UniverseObject, INetworkManager
UnregisterPacketRoutersFor(removedBehaviour, serverPacketRouters, serverPacketArrivalMethods);
}
protected override void OnExitingUniverse(IUniverse universe) => _networkEntityCollector.Unassign();
protected override void OnEnteringUniverse(IUniverse universe)
protected override void OnExitedUniverse(IUniverse universe) => _networkEntityCollector.Unassign();
protected override void OnEnteredUniverse(IUniverse universe)
{
_networkEntityCollector.Assign(universe);
NetworkCommunicator = this.GetRequiredUniverseObjectInParent<INetworkCommunicator>();
NetworkCommunicator = BehaviourController.GetRequiredBehaviourInParent<INetworkCommunicator>();
}
#endregion