Skip to content

Commit 3bc7bee

Browse files
Run dotnet format on all projects
Note that Profiler is now a fully static class
1 parent a6297eb commit 3bc7bee

147 files changed

Lines changed: 200 additions & 948 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Template.GodotUtils/Debugging/JsonExceptionHandler.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,12 @@ public static void Handle(JsonException ex, string jsonText, string path)
4444
errorMessage.AppendLine();
4545

4646
for (int i = startLine; i < lineIndex; i++)
47-
{
4847
errorMessage.AppendLine(lines[i]);
49-
}
5048

5149
errorMessage.AppendLine($"{problematicLine} <--- Syntax error could be on this line or the next line");
5250

5351
for (int i = lineIndex + 1; i < endLine; i++)
54-
{
5552
errorMessage.AppendLine(lines[i]);
56-
}
5753

5854
GD.Print(errorMessage);
5955
}

Template.GodotUtils/Deprecated/EventManager.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,11 @@ public void Notify(TEvent eventType, params object[] args)
9797
{
9898
// Unknown event types simply have no listeners to notify.
9999
if (!_eventListeners.TryGetValue(eventType, out List<Listener>? value))
100-
{
101100
return;
102-
}
103101

104102
// Iterate snapshot to avoid collection-modified issues during callbacks.
105103
foreach (Listener listener in value.ToList()) // if ToList() is not here then issue #137 will occur
106-
{
107104
((Action<object[]>)listener.Action)(args);
108-
}
109105
}
110106

111107
/// <summary>

Template.GodotUtils/Extensions/AnimatedSprite2DExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ public static int GetPixelBottomY(this AnimatedSprite2D sprite, string anim = ""
154154
{
155155
// Stop once an opaque pixel is reached in center column.
156156
if (img.GetPixel(size.X / 2, y).A != 0)
157-
{
158157
break;
159-
}
160158

161159
diff++;
162160
}

Template.GodotUtils/Extensions/CollectionsExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ public static class CollectionsExtensions
1717
public static void ForEach<T>(this IEnumerable<T> value, Action<T> action)
1818
{
1919
foreach (T element in value)
20-
{
2120
action(element);
22-
}
2321
}
2422
}

Template.GodotUtils/Extensions/CollisionObject2DExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ private static int[] ConvertToUniqueIntArray(string numberString)
8484
{
8585
// Keep only numeric characters as layer indices.
8686
if (char.IsDigit(c))
87-
{
8887
uniqueNumbers.Add(int.Parse(c.ToString()));
89-
}
9088
}
9189

9290
return [.. uniqueNumbers];

Template.GodotUtils/Extensions/DictionaryExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ public static class DictionaryExtensions
1717
public static void Merge<TKey, TValue>(this Dictionary<TKey, TValue> me, Dictionary<TKey, TValue> merge) where TKey : notnull
1818
{
1919
foreach (KeyValuePair<TKey, TValue> item in merge)
20-
{
2120
me[item.Key] = item.Value;
22-
}
2321
}
2422
}

Template.GodotUtils/Extensions/MathExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static class MathExtensions
1717
/// <returns>Interpolated color value.</returns>
1818
public static Color Lerp(this Color color1, Color color2, float t)
1919
{
20-
return color1 * (1 - t) + color2 * t;
20+
return (color1 * (1 - t)) + (color2 * t);
2121
}
2222

2323
/// <summary>
@@ -31,7 +31,7 @@ public static Color Lerp(this Color color1, Color color2, float t)
3131
/// <returns>Input value mapped into the destination range.</returns>
3232
public static float Remap(this float value, float from1, float to1, float from2, float to2)
3333
{
34-
return (value - from1) / (to1 - from1) * (to2 - from2) + from2;
34+
return ((value - from1) / (to1 - from1) * (to2 - from2)) + from2;
3535
}
3636

3737
/// <summary>

Template.GodotUtils/Extensions/NodeExtensions.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static class NodeExtensions
1313
{
1414
/// <summary>
1515
/// Retrieves an autoload from the scene tree using the given name.
16-
/// <code>Global global = someNode.GetAutoload&lt;Global&gt;("Global");</code>
16+
/// <c>Global global = someNode.GetAutoload&lt;Global&gt;("Global");</c>
1717
/// </summary>
1818
/// <typeparam name="T">Type of the autoload node, must inherit from Node.</typeparam>
1919
/// <param name="node">Node used to access the current scene tree.</param>
@@ -114,9 +114,7 @@ private static void RecursiveTypeMatchSearch(Node node, Type type, List<Node> no
114114
nodes.Add(node);
115115

116116
foreach (Node child in node.GetChildren())
117-
{
118117
RecursiveTypeMatchSearch(child, type, nodes);
119-
}
120118
}
121119

122120
/// <summary>
@@ -252,9 +250,7 @@ private static void FindChildrenOfType<T>(Node node, List<T> children, bool recu
252250

253251
// Continue traversal when recursive mode is enabled.
254252
if (recursive)
255-
{
256253
FindChildrenOfType(child, children, recursive);
257-
}
258254
}
259255
}
260256

@@ -265,9 +261,7 @@ private static void FindChildrenOfType<T>(Node node, List<T> children, bool recu
265261
public static void QueueFreeChildren(this Node parentNode)
266262
{
267263
foreach (Node node in parentNode.GetChildren())
268-
{
269264
node.QueueFree();
270-
}
271265
}
272266

273267
/// <summary>
@@ -279,9 +273,7 @@ public static void RemoveAllGroups(this Node node)
279273
Godot.Collections.Array<StringName> groups = node.GetGroups();
280274

281275
for (int i = 0; i < groups.Count; i++)
282-
{
283276
node.RemoveFromGroup(groups[i]);
284-
}
285277
}
286278

287279
/// <summary>
@@ -296,8 +288,6 @@ public static void TraverseNodes(this Node node, Action<Node> code)
296288

297289
// Recurse into children
298290
foreach (Node child in node.GetChildren())
299-
{
300291
TraverseNodes(child, code);
301-
}
302292
}
303293
}

Template.GodotUtils/Extensions/PrintExtensions.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ public static void PrintFormatted(this object v)
4343
{
4444
// Null collections produce null output.
4545
if (value == null)
46-
{
4746
return null;
48-
}
4947

5048
// Choose multiline or single-line format based on caller preference.
5149
if (newLine)
@@ -111,9 +109,7 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ
111109

112110
// Ignore properties whose type is a Godot engine type.
113111
if (prop.PropertyType != null && (prop.PropertyType == ignoredProp || prop.PropertyType.IsSubclassOf(ignoredProp)))
114-
{
115112
prop.Ignored = true;
116-
}
117113
}
118114

119115
return prop;

Template.GodotUtils/Extensions/RayCast2DExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ public static void SetCollisionMask(this RayCast2D node, params int[] values)
4242
node.CollisionMask = 0;
4343

4444
foreach (int value in values)
45-
{
4645
node.SetCollisionMaskValue(value, true);
47-
}
4846
}
4947

5048
/// <summary>

0 commit comments

Comments
 (0)