diff --git a/TLM/CSUtil.CameraControl b/TLM/CSUtil.CameraControl index 48a551209..a908f9cbe 160000 --- a/TLM/CSUtil.CameraControl +++ b/TLM/CSUtil.CameraControl @@ -1 +1 @@ -Subproject commit 48a5512090b28d98310583ae461ed0d32f867647 +Subproject commit a908f9cbe1d3bcfa632ca6557ad6fc028ddbcf76 diff --git a/TLM/OptionsFramework b/TLM/OptionsFramework index 378ce2163..d3fda0263 160000 --- a/TLM/OptionsFramework +++ b/TLM/OptionsFramework @@ -1 +1 @@ -Subproject commit 378ce2163c9328218a7d661f82207f495998b5e0 +Subproject commit d3fda02633d701a1efc41f7e598074fa63d9bae2 diff --git a/TLM/TLM/Custom/PathFinding/CustomPathFind.cs b/TLM/TLM/Custom/PathFinding/CustomPathFind.cs index 2b6c649f7..c6210310a 100644 --- a/TLM/TLM/Custom/PathFinding/CustomPathFind.cs +++ b/TLM/TLM/Custom/PathFinding/CustomPathFind.cs @@ -341,7 +341,7 @@ private void PathFindImplementation(uint unit, ref PathUnit data) { (queueItem_.vehicleType & ExtVehicleType.RoadVehicle) != ExtVehicleType.None; isLaneArrowObeyingEntity_ = - (! Options.relaxedBusses || queueItem_.vehicleType != ExtVehicleType.Bus) && + (!Options.relaxedBusses || queueItem_.vehicleType != ExtVehicleType.Bus) && (vehicleTypes_ & LaneArrowManager.VEHICLE_TYPES) != VehicleInfo.VehicleType.None && (queueItem_.vehicleType & LaneArrowManager.EXT_VEHICLE_TYPES) != ExtVehicleType.None; #if DEBUG @@ -3092,7 +3092,7 @@ private bool ProcessItemCosts( (nextLaneInfo.m_vehicleType & vehicleTypes_) != VehicleInfo.VehicleType.None) { #if ADVANCEDAI && ROUTING - if (! enableAdvancedAI) { + if (!enableAdvancedAI) { #endif int firstTarget = netManager.m_lanes.m_buffer[nextLaneId].m_firstTarget; int lastTarget = netManager.m_lanes.m_buffer[nextLaneId].m_lastTarget; diff --git a/TLM/TLM/Manager/Impl/JunctionRestrictionsManager.cs b/TLM/TLM/Manager/Impl/JunctionRestrictionsManager.cs index 5d9b21546..eea8409b1 100644 --- a/TLM/TLM/Manager/Impl/JunctionRestrictionsManager.cs +++ b/TLM/TLM/Manager/Impl/JunctionRestrictionsManager.cs @@ -567,7 +567,7 @@ public bool GetDefaultEnteringBlockedJunctionAllowed( #else const bool logLogic = false; #endif - if (! Services.NetService.IsSegmentValid(segmentId)) { + if (!Services.NetService.IsSegmentValid(segmentId)) { return false; } diff --git a/TLM/TLM/Manager/Impl/ParkingRestrictionsManager.cs b/TLM/TLM/Manager/Impl/ParkingRestrictionsManager.cs index a74145e94..24cd58568 100644 --- a/TLM/TLM/Manager/Impl/ParkingRestrictionsManager.cs +++ b/TLM/TLM/Manager/Impl/ParkingRestrictionsManager.cs @@ -106,7 +106,7 @@ protected override void HandleInvalidSegment(ref ExtSegment seg) { } protected override void HandleValidSegment(ref ExtSegment seg) { - if (! MayHaveParkingRestriction(seg.segmentId)) { + if (!MayHaveParkingRestriction(seg.segmentId)) { parkingAllowed[seg.segmentId][0] = true; parkingAllowed[seg.segmentId][1] = true; } diff --git a/TLM/TLM/Manager/Impl/SegmentEndManager.cs b/TLM/TLM/Manager/Impl/SegmentEndManager.cs index 4c6b6c869..2b6e6e51c 100644 --- a/TLM/TLM/Manager/Impl/SegmentEndManager.cs +++ b/TLM/TLM/Manager/Impl/SegmentEndManager.cs @@ -106,7 +106,7 @@ public bool UpdateSegmentEnd(ushort segmentId, bool startNode) { const bool logPriority = false; #endif - if (! Services.NetService.IsSegmentValid(segmentId)) { + if (!Services.NetService.IsSegmentValid(segmentId)) { if (logPriority) { Log._Debug( $"SegmentEndManager.UpdateSegmentEnd({segmentId}, {startNode}): Segment " + diff --git a/TLM/TLM/Manager/Impl/TrafficLightSimulationManager.cs b/TLM/TLM/Manager/Impl/TrafficLightSimulationManager.cs index 7fec825ff..c8df49fb3 100644 --- a/TLM/TLM/Manager/Impl/TrafficLightSimulationManager.cs +++ b/TLM/TLM/Manager/Impl/TrafficLightSimulationManager.cs @@ -46,7 +46,7 @@ protected override void InternalPrintDebugInfo() { Log._Debug($"Traffic light simulations:"); for (int i = 0; i < TrafficLightSimulations.Length; ++i) { - if (! TrafficLightSimulations[i].HasSimulation()) { + if (!TrafficLightSimulations[i].HasSimulation()) { continue; } diff --git a/TLM/TLM/Patch/_InfoManager/SetModePatch.cs b/TLM/TLM/Patch/_InfoManager/SetModePatch.cs index 5f07b25ba..13cb1e71e 100644 --- a/TLM/TLM/Patch/_InfoManager/SetModePatch.cs +++ b/TLM/TLM/Patch/_InfoManager/SetModePatch.cs @@ -20,7 +20,7 @@ public static void Prefix(InfoMode mode, SubInfoMode subMode) mode == InfoMode.None || RoadSelectionUtil.IsNetAdjustMode(mode, (int)subMode); } - if (RoadSelectionUtil.IsNetAdjustMode(mode,(int)subMode)) + if (RoadSelectionUtil.IsNetAdjustMode(mode, (int)subMode)) { // UI to be handled by Default tool ModUI.instance_.CloseMainMenu(); diff --git a/TLM/TLM/State/GlobalConfig.cs b/TLM/TLM/State/GlobalConfig.cs index dfbdc3b91..34b2b2dd6 100644 --- a/TLM/TLM/State/GlobalConfig.cs +++ b/TLM/TLM/State/GlobalConfig.cs @@ -105,7 +105,7 @@ private static GlobalConfig WriteDefaultConfig(GlobalConfig oldConfig, bool rese return conf; } - private static DateTime WriteConfig(GlobalConfig config, string filename=FILENAME) { + private static DateTime WriteConfig(GlobalConfig config, string filename = FILENAME) { try { Log.Info($"Writing global config to file '{filename}'..."); XmlSerializer serializer = new XmlSerializer(typeof(GlobalConfig)); @@ -183,7 +183,7 @@ public static GlobalConfig Load(out DateTime modifiedTime) { } } - public static void Reload(bool checkVersion=true) { + public static void Reload(bool checkVersion = true) { DateTime modifiedTime; GlobalConfig conf = Load(out modifiedTime); if (checkVersion && conf.Version != -1 && conf.Version < LATEST_VERSION) { @@ -208,7 +208,7 @@ public static void Reload(bool checkVersion=true) { } } - public static void Reset(GlobalConfig oldConfig, bool resetAll=false) { + public static void Reset(GlobalConfig oldConfig, bool resetAll = false) { Log.Info($"Resetting global config."); DateTime modifiedTime; Instance = WriteDefaultConfig(oldConfig, resetAll, out modifiedTime); diff --git a/TLM/TLM/State/Keybinds/KeybindUI.cs b/TLM/TLM/State/Keybinds/KeybindUI.cs index 569a17ab4..b45b06822 100644 --- a/TLM/TLM/State/Keybinds/KeybindUI.cs +++ b/TLM/TLM/State/Keybinds/KeybindUI.cs @@ -210,7 +210,7 @@ private void OnBindingKeyDown(UIComponent comp, UIKeyEventParameter evParam) { var keybindButton = evParam.source as UIButton; var inputKey = SavedInputKey.Encode(evParam.keycode, evParam.control, evParam.shift, evParam.alt); - var editable = (KeybindSetting.Editable) evParam.source.objectUserData; + var editable = (KeybindSetting.Editable)evParam.source.objectUserData; var category = editable.Target.Category; if (evParam.keycode != KeyCode.Escape) { @@ -233,7 +233,7 @@ private void OnBindingKeyDown(UIComponent comp, UIKeyEventParameter evParam) { } private void OnBindingMouseDown(UIComponent comp, UIMouseEventParameter evParam) { - var editable = (KeybindSetting.Editable) evParam.source.objectUserData; + var editable = (KeybindSetting.Editable)evParam.source.objectUserData; var keybindButton = evParam.source as UIButton; // This will only work if the user is not in the process of changing the shortcut @@ -367,7 +367,7 @@ private static InputKey GetDefaultEntryInGameSettings(string entryName) { var obj = field.GetValue(null); if (obj is InputKey) { - return (InputKey) obj; + return (InputKey)obj; } return 0; diff --git a/TLM/TLM/TrafficLight/Impl/CustomSegmentLights.cs b/TLM/TLM/TrafficLight/Impl/CustomSegmentLights.cs index 0e64c4195..2e9c2b38e 100644 --- a/TLM/TLM/TrafficLight/Impl/CustomSegmentLights.cs +++ b/TLM/TLM/TrafficLight/Impl/CustomSegmentLights.cs @@ -419,7 +419,7 @@ public void OnChange(bool calculateAutoPedLight = true) { } } - public void CalculateAutoPedestrianLightState(ref NetNode node, bool propagate=true) { + public void CalculateAutoPedestrianLightState(ref NetNode node, bool propagate = true) { #if DEBUG bool logTrafficLights = DebugSwitch.TimedTrafficLights.Get() && DebugSettings.NodeId == NodeId; diff --git a/TLM/TLM/UI/Helpers/CheckboxOption.cs b/TLM/TLM/UI/Helpers/CheckboxOption.cs index dbf12490d..dcc58b6b0 100644 --- a/TLM/TLM/UI/Helpers/CheckboxOption.cs +++ b/TLM/TLM/UI/Helpers/CheckboxOption.cs @@ -28,7 +28,7 @@ public override void AddUI(UIHelperBase container) { T(Label), Value, this.OnValueChanged) as UICheckBox; - if (Tooltip!=null) { + if (Tooltip != null) { _ui.tooltip = T(Tooltip); } if (Indent) { diff --git a/TLM/TLM/UI/Helpers/ExtUITabStrip.cs b/TLM/TLM/UI/Helpers/ExtUITabStrip.cs index 8739631e6..8281c5be1 100644 --- a/TLM/TLM/UI/Helpers/ExtUITabStrip.cs +++ b/TLM/TLM/UI/Helpers/ExtUITabStrip.cs @@ -78,7 +78,7 @@ private UIScrollablePanel CreateScrollablePanel(UIPanel panel) { return scrollablePanel; } - public UIHelper AddTabPage(string name, bool scrollBars=true) { + public UIHelper AddTabPage(string name, bool scrollBars = true) { UIButton tabButton = base.AddTab(name); tabButton.normalBgSprite = "SubBarButtonBase"; tabButton.disabledBgSprite = "SubBarButtonBaseDisabled"; diff --git a/TLM/TLM/UI/SubTools/LaneArrows/LaneArrowTool.cs b/TLM/TLM/UI/SubTools/LaneArrows/LaneArrowTool.cs index 6a06e1e79..d6b0c3761 100644 --- a/TLM/TLM/UI/SubTools/LaneArrows/LaneArrowTool.cs +++ b/TLM/TLM/UI/SubTools/LaneArrows/LaneArrowTool.cs @@ -495,7 +495,7 @@ private bool HasSegmentEndLaneArrows(ushort segmentId, ushort nodeId) { #endif ExtSegmentEndManager segEndMan = ExtSegmentEndManager.Instance; int segmentEndId = segEndMan.GetIndex(segmentId, nodeId); - if (segmentEndId <0) { + if (segmentEndId < 0) { Log._Debug($"Node {nodeId} is not connected to segment {segmentId}"); return false; } diff --git a/TLM/TLM/UI/SubTools/LaneConnectorTool.cs b/TLM/TLM/UI/SubTools/LaneConnectorTool.cs index bb8a1a0cc..07ba97e50 100644 --- a/TLM/TLM/UI/SubTools/LaneConnectorTool.cs +++ b/TLM/TLM/UI/SubTools/LaneConnectorTool.cs @@ -427,7 +427,7 @@ private static bool ArrangeOneWay(ushort nodeId, List segments) { if (nodeId.ToNode().CountSegments() > 4) return false; foreach (var segmentId in segments) { - if (segmentId!= 0 && !segMan.CalculateIsOneWay(segmentId)) + if (segmentId != 0 && !segMan.CalculateIsOneWay(segmentId)) return false; } int sourceCount = segments diff --git a/TLM/TLM/UI/SubTools/PrioritySigns/PrioritySignsTool.cs b/TLM/TLM/UI/SubTools/PrioritySigns/PrioritySignsTool.cs index c08da5371..1b141896a 100644 --- a/TLM/TLM/UI/SubTools/PrioritySigns/PrioritySignsTool.cs +++ b/TLM/TLM/UI/SubTools/PrioritySigns/PrioritySignsTool.cs @@ -25,7 +25,7 @@ public class PrioritySignsTool UI.MainMenu.IOnscreenDisplayProvider { public enum PrioritySignsMassEditMode { - Min=0, + Min = 0, MainYield = 0, MainStop = 1, YieldMain = 2, @@ -93,7 +93,7 @@ public override void OnPrimaryClickOverlay() { TraverseDirection.AnyDirection, TraverseSide.Straight, SegmentStopCriterion.None, - (_)=>true); + (_) => true); segmentList = new List(segments); } @@ -299,7 +299,7 @@ private void ShowGUI(bool viewOnly) { bool showRemoveButton = false; foreach (ushort nodeId in currentPriorityNodeIds) { - if (! Constants.ServiceFactory.NetService.IsNodeValid(nodeId)) { + if (!Constants.ServiceFactory.NetService.IsNodeValid(nodeId)) { continue; } diff --git a/TLM/TLM/UI/SubTools/SpeedLimits/SpeedLimitsTool.cs b/TLM/TLM/UI/SubTools/SpeedLimits/SpeedLimitsTool.cs index 9ff9e56f8..224551b16 100644 --- a/TLM/TLM/UI/SubTools/SpeedLimits/SpeedLimitsTool.cs +++ b/TLM/TLM/UI/SubTools/SpeedLimits/SpeedLimitsTool.cs @@ -315,7 +315,7 @@ private void ShowSigns(bool viewOnly) { } // no speed limit overlay on selected segment when in vehicle restrictions mode - hover|= DrawSpeedLimitHandles( + hover |= DrawSpeedLimitHandles( segmentId, ref netManager.m_segments.m_buffer[segmentId], viewOnly, @@ -569,7 +569,7 @@ private void GuiSpeedLimitsWindow(int num) { foreach (SpeedValue speedLimit in allSpeedLimits) { // Highlight palette item if it is very close to its float speed - if (currentPaletteSpeedLimit !=null && + if (currentPaletteSpeedLimit != null && FloatUtil.NearlyEqual( (float)currentPaletteSpeedLimit?.GameUnits, speedLimit.GameUnits)) { @@ -897,7 +897,7 @@ private bool DrawSpeedLimitHandles(ushort segmentId, GeometryUtil.CalculateSegmentCenterByDir( segmentId, segCenter, - speedLimitSignSize*TrafficManagerTool.MAX_ZOOM); + speedLimitSignSize * TrafficManagerTool.MAX_ZOOM); } foreach (KeyValuePair e in segCenter) { diff --git a/TLM/TLM/UI/SubTools/TimedTrafficLights/TimedTrafficLightsTool.cs b/TLM/TLM/UI/SubTools/TimedTrafficLights/TimedTrafficLightsTool.cs index 9e7e8c45b..41dbeb891 100644 --- a/TLM/TLM/UI/SubTools/TimedTrafficLights/TimedTrafficLightsTool.cs +++ b/TLM/TLM/UI/SubTools/TimedTrafficLights/TimedTrafficLightsTool.cs @@ -1468,7 +1468,7 @@ private void ShowGUI() { liveSegmentLights.StartNode); bool timedActive = timedNode.IsStarted(); - if (! timedActive) { + if (!timedActive) { liveSegmentLights.MakeRedOrGreen(); } diff --git a/TLM/TLM/UI/TrafficManagerTool.cs b/TLM/TLM/UI/TrafficManagerTool.cs index ef8e46601..93fff0d47 100644 --- a/TLM/TLM/UI/TrafficManagerTool.cs +++ b/TLM/TLM/UI/TrafficManagerTool.cs @@ -350,7 +350,7 @@ public override void RenderGeometry(RenderManager.CameraInfo cameraInfo) { public override void RenderOverlay(RenderManager.CameraInfo cameraInfo) { RenderOverlayImpl(cameraInfo); - if (GetToolMode()==ToolMode.None) { + if (GetToolMode() == ToolMode.None) { DefaultRenderOverlay(cameraInfo); } } diff --git a/TLM/TLM/Util/AutoTimedTrafficLights.cs b/TLM/TLM/Util/AutoTimedTrafficLights.cs index 8d586d33f..71b32965a 100644 --- a/TLM/TLM/Util/AutoTimedTrafficLights.cs +++ b/TLM/TLM/Util/AutoTimedTrafficLights.cs @@ -368,7 +368,7 @@ private static bool NeedsShortOnly(ushort segmentId, ushort nodeId) { return false; } if (nShort == 1) { - ushort nextSegmentId = RHT? seg.GetRightSegment(nodeId) : seg.GetLeftSegment(nodeId); + ushort nextSegmentId = RHT ? seg.GetRightSegment(nodeId) : seg.GetLeftSegment(nodeId); return !segMan.CalculateIsOneWay(nextSegmentId); } int nForward = CountDirSegs(segmentId, nodeId, ArrowDirection.Forward); diff --git a/TLM/TLM/Util/RoadSelectionUtil.cs b/TLM/TLM/Util/RoadSelectionUtil.cs index aae115dbd..cb8226a4d 100644 --- a/TLM/TLM/Util/RoadSelectionUtil.cs +++ b/TLM/TLM/Util/RoadSelectionUtil.cs @@ -45,7 +45,7 @@ public static void CopySegmentName(ushort sourceSegmentID, ushort targetSegmentI /// public static void SetRoad(ushort segmentId, IEnumerable segmentIDs) { foreach(var targetSegmentID in segmentIDs) { - if(targetSegmentID!= segmentId&& targetSegmentID != 0) { + if(targetSegmentID != segmentId && targetSegmentID != 0) { CopySegmentName(segmentId, targetSegmentID); } } diff --git a/TLM/TLM/Util/Shortcuts.cs b/TLM/TLM/Util/Shortcuts.cs index 204c148e1..774240680 100644 --- a/TLM/TLM/Util/Shortcuts.cs +++ b/TLM/TLM/Util/Shortcuts.cs @@ -126,7 +126,7 @@ internal static string ToSTR(this IEnumerable enumerable) { internal static string ToSTR(this List laneList) => (from lanePos in laneList select lanePos.laneId).ToSTR(); - internal static void AssertEq(T a, T b, string m = "") where T:IComparable { + internal static void AssertEq(T a, T b, string m = "") where T : IComparable { if (a.CompareTo(b) != 0) { Log.Error($"Assertion failed. Expected {a} == {b} | " + m); } diff --git a/TLM/TMPE.CitiesGameBridge/Service/NetService.cs b/TLM/TMPE.CitiesGameBridge/Service/NetService.cs index e32cc9d1e..02fd38f65 100644 --- a/TLM/TMPE.CitiesGameBridge/Service/NetService.cs +++ b/TLM/TMPE.CitiesGameBridge/Service/NetService.cs @@ -307,7 +307,7 @@ public IList GetSortedLanes(ushort segmentId, NetInfo.LaneType? laneTypeFilter = null, VehicleInfo.VehicleType? vehicleTypeFilter = null, bool reverse = false, - bool sort=true) { + bool sort = true) { // TODO refactor together with getSegmentNumVehicleLanes, especially the vehicle type and lane type checks NetManager netManager = Singleton.instance; var laneList = new List(); diff --git a/TLM/TMPE.UnitTest/Translation/CsvParser.cs b/TLM/TMPE.UnitTest/Translation/CsvParser.cs index aead29a7e..14d62a200 100644 --- a/TLM/TMPE.UnitTest/Translation/CsvParser.cs +++ b/TLM/TMPE.UnitTest/Translation/CsvParser.cs @@ -24,8 +24,8 @@ public class CsvParser { public static void InitializeClass(TestContext testContext) { testBlock_LF = File.ReadAllBytes("./Translation/TestFiles/TestBlock_LF.test"); testBlock_CRLF = File.ReadAllBytes("./Translation/TestFiles/TestBlock_CRLF.test"); - multilineTestBlock_LF =File.ReadAllBytes("./Translation/TestFiles/MultilineTestBlock_LF.test"); - multilineTestBlock_CRLF =File.ReadAllBytes("./Translation/TestFiles/MultilineTestBlock_CRLF.test"); + multilineTestBlock_LF = File.ReadAllBytes("./Translation/TestFiles/MultilineTestBlock_LF.test"); + multilineTestBlock_CRLF = File.ReadAllBytes("./Translation/TestFiles/MultilineTestBlock_CRLF.test"); PrepareData(testBlock_LF, out testBlock_LF_Columns, out testBlock_LF_DataBlock); PrepareData(testBlock_CRLF, out testBlock_CRLF_Columns, out testBlock_CRLF_DataBlock); PrepareData(multilineTestBlock_LF, out multilineTestBlock_LF_Columns, out multilineTestBlock_LF_DataBlock); @@ -40,7 +40,7 @@ private static void PrepareData(byte[] testFileData, out List columns, o using (var sr = new StreamReader(m)) { object[] args = {sr, null, null}; lookupTableType.InvokeStatic("ReadLines", args); - columnsRow =(string)args[1]; + columnsRow = (string)args[1]; dataBlock = (string)args[2]; } }