Misc tweaks, sealed classes

This commit is contained in:
Kurt
2026-01-17 22:12:37 -06:00
parent 666912a93b
commit 7ea5c03aa3
78 changed files with 187 additions and 331 deletions

View File

@@ -5,11 +5,8 @@
namespace NHSE.WinForms;
public class SysBotController
public sealed class SysBotController(InjectionType type)
{
public SysBotController(InjectionType type) => Type = type;
private readonly InjectionType Type;
public readonly SysBot Bot = new();
private readonly Settings Settings = Settings.Default;
@@ -42,7 +39,7 @@ public bool Connect(string ip, string port)
public uint GetDefaultOffset()
{
var settings = Settings;
return Type switch
return type switch
{
InjectionType.Generic => settings.SysBotGenericOffset,
InjectionType.Pouch => settings.SysBotPouchOffset,
@@ -53,7 +50,7 @@ public uint GetDefaultOffset()
public void SetOffset(uint value)
{
var settings = Settings;
switch (Type)
switch (type)
{
case InjectionType.Generic: settings.SysBotGenericOffset = value; break;
case InjectionType.Pouch: settings.SysBotPouchOffset = value; break;