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:
@@ -10,7 +10,7 @@ namespace Engine.Systems.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 : Behaviour, INetworkManager
|
||||
public class NetworkManager : Behaviour, IEnterUniverse, IExitUniverse, INetworkManager
|
||||
{
|
||||
private readonly Dictionary<Type, Dictionary<Type, List<MethodInfo>>> clientPacketArrivalMethods = [];
|
||||
private readonly Dictionary<Type, Dictionary<Type, List<MethodInfo>>> serverPacketArrivalMethods = [];
|
||||
@@ -230,8 +230,8 @@ public class NetworkManager : Behaviour, INetworkManager
|
||||
UnregisterPacketRoutersFor(removedBehaviour, serverPacketRouters, serverPacketArrivalMethods);
|
||||
}
|
||||
|
||||
protected override void OnExitedUniverse(IUniverse universe) => _networkEntityCollector.Unassign();
|
||||
protected override void OnEnteredUniverse(IUniverse universe)
|
||||
public void ExitUniverse(IUniverse universe) => _networkEntityCollector.Unassign();
|
||||
public void EnterUniverse(IUniverse universe)
|
||||
{
|
||||
_networkEntityCollector.Assign(universe);
|
||||
NetworkCommunicator = BehaviourController.GetRequiredBehaviourInParent<INetworkCommunicator>();
|
||||
|
Reference in New Issue
Block a user