Skip to content

Commit

Permalink
Merge pull request #918 from CitiesSkylinesMods/WarningsSA1003
Browse files Browse the repository at this point in the history
Fixed SA1003SymbolsMustBeSpacedCorrectly warnings.
  • Loading branch information
DaEgi01 committed May 31, 2020
2 parents d15619a + f4e6fa9 commit f13ed26
Show file tree
Hide file tree
Showing 24 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion TLM/CSUtil.CameraControl
2 changes: 1 addition & 1 deletion TLM/OptionsFramework
4 changes: 2 additions & 2 deletions TLM/TLM/Custom/PathFinding/CustomPathFind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/JunctionRestrictionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/ParkingRestrictionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/SegmentEndManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 " +
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Manager/Impl/TrafficLightSimulationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Patch/_InfoManager/SetModePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions TLM/TLM/State/GlobalConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions TLM/TLM/State/Keybinds/KeybindUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/TrafficLight/Impl/CustomSegmentLights.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/UI/Helpers/CheckboxOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/UI/Helpers/ExtUITabStrip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/UI/SubTools/LaneArrows/LaneArrowTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/UI/SubTools/LaneConnectorTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ private static bool ArrangeOneWay(ushort nodeId, List<ushort> 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
Expand Down
6 changes: 3 additions & 3 deletions TLM/TLM/UI/SubTools/PrioritySigns/PrioritySignsTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class PrioritySignsTool
UI.MainMenu.IOnscreenDisplayProvider
{
public enum PrioritySignsMassEditMode {
Min=0,
Min = 0,
MainYield = 0,
MainStop = 1,
YieldMain = 2,
Expand Down Expand Up @@ -93,7 +93,7 @@ public override void OnPrimaryClickOverlay() {
TraverseDirection.AnyDirection,
TraverseSide.Straight,
SegmentStopCriterion.None,
(_)=>true);
(_) => true);
segmentList = new List<ushort>(segments);
}

Expand Down Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions TLM/TLM/UI/SubTools/SpeedLimits/SpeedLimitsTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -897,7 +897,7 @@ private bool DrawSpeedLimitHandles(ushort segmentId,
GeometryUtil.CalculateSegmentCenterByDir(
segmentId,
segCenter,
speedLimitSignSize*TrafficManagerTool.MAX_ZOOM);
speedLimitSignSize * TrafficManagerTool.MAX_ZOOM);
}

foreach (KeyValuePair<NetInfo.Direction, Vector3> e in segCenter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ private void ShowGUI() {
liveSegmentLights.StartNode);

bool timedActive = timedNode.IsStarted();
if (! timedActive) {
if (!timedActive) {
liveSegmentLights.MakeRedOrGreen();
}

Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/UI/TrafficManagerTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Util/AutoTimedTrafficLights.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Util/RoadSelectionUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static void CopySegmentName(ushort sourceSegmentID, ushort targetSegmentI
/// </summary>
public static void SetRoad(ushort segmentId, IEnumerable<ushort> segmentIDs) {
foreach(var targetSegmentID in segmentIDs) {
if(targetSegmentID!= segmentId&& targetSegmentID != 0) {
if(targetSegmentID != segmentId && targetSegmentID != 0) {
CopySegmentName(segmentId, targetSegmentID);
}
}
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Util/Shortcuts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ internal static string ToSTR<T>(this IEnumerable<T> enumerable) {
internal static string ToSTR(this List<LanePos> laneList) =>
(from lanePos in laneList select lanePos.laneId).ToSTR();

internal static void AssertEq<T>(T a, T b, string m = "") where T:IComparable {
internal static void AssertEq<T>(T a, T b, string m = "") where T : IComparable {
if (a.CompareTo(b) != 0) {
Log.Error($"Assertion failed. Expected {a} == {b} | " + m);
}
Expand Down
2 changes: 1 addition & 1 deletion TLM/TMPE.CitiesGameBridge/Service/NetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public IList<LanePos> 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<NetManager>.instance;
var laneList = new List<LanePos>();
Expand Down
6 changes: 3 additions & 3 deletions TLM/TMPE.UnitTest/Translation/CsvParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -40,7 +40,7 @@ private static void PrepareData(byte[] testFileData, out List<string> 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];
}
}
Expand Down

0 comments on commit f13ed26

Please sign in to comment.