1- // #define DEBUGFLAGS
1+ // #define DEBUGFLAGS
22
33namespace TrafficManager . State {
44 using ColossalFramework ;
@@ -10,6 +10,7 @@ namespace TrafficManager.State {
1010 using TrafficManager . API . Traffic . Enums ;
1111 using TrafficManager . Manager . Impl ;
1212 using TrafficManager . State . ConfigData ;
13+ using static TrafficManager . Util . Shortcuts ;
1314
1415 [ Obsolete ]
1516 public class Flags {
@@ -166,7 +167,7 @@ public static bool MayHaveTrafficLight(ushort nodeId) {
166167 }
167168
168169 [ Obsolete ]
169- public static bool setNodeTrafficLight ( ushort nodeId , bool flag ) {
170+ public static bool SetNodeTrafficLight ( ushort nodeId , bool flag ) {
170171 if ( nodeId <= 0 ) {
171172 return false ;
172173 }
@@ -206,7 +207,7 @@ public static bool setNodeTrafficLight(ushort nodeId, bool flag) {
206207 [ Obsolete ]
207208 [ UsedImplicitly ]
208209 // Not used
209- internal static bool isNodeTrafficLight ( ushort nodeId ) {
210+ internal static bool IsNodeTrafficLight ( ushort nodeId ) {
210211 if ( nodeId <= 0 ) {
211212 return false ;
212213 }
@@ -513,7 +514,7 @@ public static void SetLaneSpeedLimit(uint laneId, float? speedLimit) {
513514 }
514515 }
515516
516- public static void removeLaneSpeedLimit ( uint laneId ) {
517+ public static void RemoveLaneSpeedLimit ( uint laneId ) {
517518 SetLaneSpeedLimit ( laneId , null ) ;
518519 }
519520
@@ -614,7 +615,7 @@ public static void SetLaneSpeedLimit(ushort segmentId,
614615 }
615616 }
616617
617- public static void setLaneAllowedVehicleTypes ( uint laneId , ExtVehicleType vehicleTypes ) {
618+ public static void SetLaneAllowedVehicleTypes ( uint laneId , ExtVehicleType vehicleTypes ) {
618619 if ( laneId <= 0 ) {
619620 return ;
620621 }
@@ -642,7 +643,7 @@ public static void setLaneAllowedVehicleTypes(uint laneId, ExtVehicleType vehicl
642643
643644 while ( laneIndex < segmentInfo . m_lanes . Length && curLaneId != 0u ) {
644645 if ( curLaneId == laneId ) {
645- setLaneAllowedVehicleTypes ( segmentId , laneIndex , laneId , vehicleTypes ) ;
646+ SetLaneAllowedVehicleTypes ( segmentId , laneIndex , laneId , vehicleTypes ) ;
646647 return ;
647648 }
648649
@@ -651,7 +652,7 @@ public static void setLaneAllowedVehicleTypes(uint laneId, ExtVehicleType vehicl
651652 }
652653 }
653654
654- public static void setLaneAllowedVehicleTypes ( ushort segmentId ,
655+ public static void SetLaneAllowedVehicleTypes ( ushort segmentId ,
655656 uint laneIndex ,
656657 uint laneId ,
657658 ExtVehicleType vehicleTypes )
@@ -696,7 +697,7 @@ public static void setLaneAllowedVehicleTypes(ushort segmentId,
696697 laneAllowedVehicleTypesArray [ segmentId ] [ laneIndex ] = vehicleTypes ;
697698 }
698699
699- public static void resetSegmentVehicleRestrictions ( ushort segmentId ) {
700+ public static void ResetSegmentVehicleRestrictions ( ushort segmentId ) {
700701 if ( segmentId <= 0 ) {
701702 return ;
702703 }
@@ -707,7 +708,7 @@ public static void resetSegmentVehicleRestrictions(ushort segmentId) {
707708 laneAllowedVehicleTypesArray [ segmentId ] = null ;
708709 }
709710
710- public static void resetSegmentArrowFlags ( ushort segmentId ) {
711+ public static void ResetSegmentArrowFlags ( ushort segmentId ) {
711712 if ( segmentId <= 0 ) {
712713 return ;
713714 }
@@ -732,7 +733,24 @@ public static void resetSegmentArrowFlags(ushort segmentId) {
732733 }
733734 }
734735
735- public static bool setLaneArrowFlags ( uint laneId ,
736+ /// <summary>
737+ /// removes the custom lane arrow flags. requires post recalculation.
738+ /// </summary>
739+ /// <param name="laneId"></param>
740+ /// <returns><c>true</c>on success, <c>false</c> otherwise</returns>
741+ public static bool ResetLaneArrowFlags ( uint laneId ) {
742+ #if DEBUGFLAGS
743+ Log . _Debug ( $ "Flags.resetLaneArrowFlags: Resetting lane arrows of lane { laneId } .") ;
744+ #endif
745+ if ( LaneConnectionManager . Instance . HasConnections ( laneId ) ) {
746+ return false ;
747+ }
748+
749+ laneArrowFlags [ laneId ] = null ;
750+ return true ;
751+ }
752+
753+ public static bool SetLaneArrowFlags ( uint laneId ,
736754 LaneArrows flags ,
737755 bool overrideHighwayArrows = false ) {
738756#if DEBUGFLAGS
@@ -1079,7 +1097,7 @@ public static void RemoveLaneArrowFlags(uint laneId) {
10791097 }
10801098 }
10811099
1082- internal static void removeHighwayLaneArrowFlagsAtSegment ( ushort segmentId ) {
1100+ internal static void RemoveHighwayLaneArrowFlagsAtSegment ( ushort segmentId ) {
10831101 NetSegment [ ] segmentsBuffer = Singleton < NetManager > . instance . m_segments . m_buffer ;
10841102
10851103 if ( ( segmentsBuffer [ segmentId ] . m_flags &
0 commit comments