Skip to content

Commit

Permalink
Update call sites to use new implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
originalfoo committed Feb 26, 2022
1 parent 634102d commit 3a5f455
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion TLM/TLM/Manager/Impl/JunctionRestrictionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace TrafficManager.Manager.Impl {
using static CSUtil.Commons.TernaryBoolUtil;
using TrafficManager.Util;
using TrafficManager.Util.Extensions;
using TrafficManager.Lifecycle;

public class JunctionRestrictionsManager
: AbstractGeometryObservingManager,
Expand Down Expand Up @@ -1018,7 +1019,7 @@ private void OnSegmentChange(ushort segmentId,

if (requireRecalc) {
RoutingManager.Instance.RequestRecalculation(segmentId);
if (OptionsManager.Instance.MayPublishSegmentChanges()) {
if (TMPELifecycle.Instance.MayPublishSegmentChanges()) {
ExtSegmentManager.Instance.PublishSegmentChanges(segmentId);
}
}
Expand Down
3 changes: 2 additions & 1 deletion TLM/TLM/Manager/Impl/LaneArrowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace TrafficManager.Manager.Impl {
using UnityEngine;
using static TrafficManager.Util.Shortcuts;
using TrafficManager.Util.Extensions;
using TrafficManager.Lifecycle;

public class LaneArrowManager
: AbstractGeometryObservingManager,
Expand Down Expand Up @@ -200,7 +201,7 @@ private static void RecalculateFlags(uint laneId) {
private void OnLaneChange(uint laneId) {
ushort segment = laneId.ToLane().m_segment;
RoutingManager.Instance.RequestRecalculation(segment);
if (OptionsManager.Instance.MayPublishSegmentChanges()) {
if (TMPELifecycle.Instance.MayPublishSegmentChanges()) {
ExtSegmentManager.Instance.PublishSegmentChanges(segment);
}
}
Expand Down
9 changes: 5 additions & 4 deletions TLM/TLM/Manager/Impl/LaneConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace TrafficManager.Manager.Impl {
using static TrafficManager.Util.Shortcuts;
using TrafficManager.Util;
using TrafficManager.Util.Extensions;
using TrafficManager.Lifecycle;

public class LaneConnectionManager
: AbstractGeometryObservingManager,
Expand Down Expand Up @@ -247,7 +248,7 @@ internal bool RemoveLaneConnection(uint laneId1, uint laneId2, bool startNode1)
ref NetNode commonNode = ref commonNodeId.ToNode();
RoutingManager.Instance.RequestNodeRecalculation(ref commonNode);

if (OptionsManager.Instance.MayPublishSegmentChanges()) {
if (TMPELifecycle.Instance.MayPublishSegmentChanges()) {
ExtSegmentManager extSegmentManager = ExtSegmentManager.Instance;
extSegmentManager.PublishSegmentChanges(segmentId1);
extSegmentManager.PublishSegmentChanges(segmentId2);
Expand Down Expand Up @@ -310,7 +311,7 @@ internal void RemoveLaneConnectionsFromSegment(ushort segmentId,
if (recalcAndPublish) {
RoutingManager.Instance.RequestRecalculation(segmentId);

if (OptionsManager.Instance.MayPublishSegmentChanges()) {
if (TMPELifecycle.Instance.MayPublishSegmentChanges()) {
ExtSegmentManager.Instance.PublishSegmentChanges(segmentId);
}
}
Expand Down Expand Up @@ -364,7 +365,7 @@ internal void RemoveLaneConnections(uint laneId,
ushort segment = laneId.ToLane().m_segment;
RoutingManager.Instance.RequestRecalculation(segment);

if (OptionsManager.Instance.MayPublishSegmentChanges()) {
if (TMPELifecycle.Instance.MayPublishSegmentChanges()) {
ExtSegmentManager.Instance.PublishSegmentChanges(segment);
}
}
Expand Down Expand Up @@ -426,7 +427,7 @@ internal bool AddLaneConnection(uint sourceLaneId,
RoutingManager.Instance.RequestRecalculation(sourceSegmentId, false);
RoutingManager.Instance.RequestRecalculation(targetSegmentId, false);

if (OptionsManager.Instance.MayPublishSegmentChanges()) {
if (TMPELifecycle.Instance.MayPublishSegmentChanges()) {
ExtSegmentManager extSegmentManager = ExtSegmentManager.Instance;
extSegmentManager.PublishSegmentChanges(sourceSegmentId);
extSegmentManager.PublishSegmentChanges(targetSegmentId);
Expand Down
7 changes: 4 additions & 3 deletions TLM/TLM/Manager/Impl/VehicleRestrictionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace TrafficManager.Manager.Impl {
using TrafficManager.Traffic;
using TrafficManager.Util;
using TrafficManager.Util.Extensions;
using TrafficManager.Lifecycle;

public class VehicleRestrictionsManager
: AbstractGeometryObservingManager,
Expand Down Expand Up @@ -447,7 +448,7 @@ internal bool SetAllowedVehicleTypes(ushort segmentId,

NotifyStartEndNode(segmentId);

if (OptionsManager.Instance.MayPublishSegmentChanges()) {
if (TMPELifecycle.Instance.MayPublishSegmentChanges()) {
ExtSegmentManager.Instance.PublishSegmentChanges(segmentId);
}

Expand Down Expand Up @@ -494,7 +495,7 @@ public void AddAllowedType(ushort segmentId,
Flags.SetLaneAllowedVehicleTypes(segmentId, laneIndex, laneId, allowedTypes);
NotifyStartEndNode(segmentId);

if (OptionsManager.Instance.MayPublishSegmentChanges()) {
if (TMPELifecycle.Instance.MayPublishSegmentChanges()) {
ExtSegmentManager.Instance.PublishSegmentChanges(segmentId);
}
}
Expand Down Expand Up @@ -539,7 +540,7 @@ public void RemoveAllowedType(ushort segmentId,
Flags.SetLaneAllowedVehicleTypes(segmentId, laneIndex, laneId, allowedTypes);
NotifyStartEndNode(segmentId);

if (OptionsManager.Instance.MayPublishSegmentChanges()) {
if (TMPELifecycle.Instance.MayPublishSegmentChanges()) {
ExtSegmentManager.Instance.PublishSegmentChanges(segmentId);
}
}
Expand Down

0 comments on commit 3a5f455

Please sign in to comment.