From 3a635e85df232c537a84ed4d64844c46a028b5f4 Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Wed, 10 Jun 2026 03:22:45 +0200 Subject: [PATCH] Code cleanup --- Kernel.cs | 4 ---- Processes/CliProcess.cs | 2 ++ Processes/TestProcess.cs | 7 ++----- Processing/ProcessManager.cs | 2 +- Processing/ProcessMetrics.cs | 14 ++++---------- UI/GUI/Windows/Window.cs | 5 ++--- 6 files changed, 11 insertions(+), 23 deletions(-) diff --git a/Kernel.cs b/Kernel.cs index 26f0550..813e3d3 100644 --- a/Kernel.cs +++ b/Kernel.cs @@ -2,13 +2,9 @@ global using Sys = Cosmos.Kernel.System; using RemSox.Processes; using RemSox.Processing; -using RemSox.Processing.IPC; using RemSox.UI.CLI; using RemSox.UI.CLI.Commands; -using RemSox.UI.GUI.UIEelements.Shapes; -using RemSox.UI.GUI.Windows; -using System.Drawing; using System.Runtime; namespace RemSox; diff --git a/Processes/CliProcess.cs b/Processes/CliProcess.cs index dcc17f7..a5623df 100644 --- a/Processes/CliProcess.cs +++ b/Processes/CliProcess.cs @@ -54,7 +54,9 @@ internal class CliProcess() : Process("Cli") private static void HandleCommand(string input) { if (string.IsNullOrWhiteSpace(input)) + { return; + } bool handled = CommandManager.TryExecute( input, diff --git a/Processes/TestProcess.cs b/Processes/TestProcess.cs index 47fba4e..8f20592 100644 --- a/Processes/TestProcess.cs +++ b/Processes/TestProcess.cs @@ -1,13 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Threading.Tasks; using RemSox.Processing; using RemSox.Processing.IPC; using RemSox.UI.GUI.UIEelements.Shapes; using RemSox.UI.GUI.Windows; +using System.Drawing; + namespace RemSox.Processes; public class TestProcess() : Process("Test Process") diff --git a/Processing/ProcessManager.cs b/Processing/ProcessManager.cs index 16de7f2..beb04db 100644 --- a/Processing/ProcessManager.cs +++ b/Processing/ProcessManager.cs @@ -180,7 +180,7 @@ public static class ProcessManager int tickTimeMs = (int)stopwatch.ElapsedMilliseconds; entry.Metrics.LastTickTimeMs = tickTimeMs; - entry.Metrics.AverageTickTimeMs = (entry.Metrics.AverageTickTimeMs * 7 + tickTimeMs) / 8; + entry.Metrics.AverageTickTimeMs = ((entry.Metrics.AverageTickTimeMs * 7) + tickTimeMs) / 8; } else { diff --git a/Processing/ProcessMetrics.cs b/Processing/ProcessMetrics.cs index 2caaf88..132c0ee 100644 --- a/Processing/ProcessMetrics.cs +++ b/Processing/ProcessMetrics.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +namespace RemSox.Processing; -namespace RemSox.Processing +public class ProcessMetrics { - public class ProcessMetrics - { - public int AverageTickTimeMs { get; set; } + public int AverageTickTimeMs { get; set; } - public int LastTickTimeMs { get; set; } - } + public int LastTickTimeMs { get; set; } } \ No newline at end of file diff --git a/UI/GUI/Windows/Window.cs b/UI/GUI/Windows/Window.cs index 86431cf..ea7df6a 100644 --- a/UI/GUI/Windows/Window.cs +++ b/UI/GUI/Windows/Window.cs @@ -1,4 +1,3 @@ -using Cosmos.Kernel.System.Graphics; using RemSox.UI.GUI.Rendering; using RemSox.UI.GUI.UIEelements; @@ -335,14 +334,14 @@ public sealed class Window(string title, int processId, int id, IRenderSource re int maxDx = interactionStartBounds.Width - minWidth; int clampedDx = Math.Min(dx, maxDx); newX = Math.Max(0, interactionStartBounds.X + clampedDx); - newW = (interactionStartBounds.X + interactionStartBounds.Width) - newX; + newW = interactionStartBounds.X + interactionStartBounds.Width - newX; } if (currentInteraction is InteractionMode.ResizeTop or InteractionMode.ResizeTopLeft or InteractionMode.ResizeTopRight) { int maxDy = interactionStartBounds.Height - minHeight; int clampedDy = Math.Min(dy, maxDy); newY = Math.Max(0, interactionStartBounds.Y + clampedDy); - newH = (interactionStartBounds.Y + interactionStartBounds.Height) - newY; + newH = interactionStartBounds.Y + interactionStartBounds.Height - newY; } Position = new Point(newX, newY);