mirror of
https://github.com/kwsch/NHSE.git
synced 2026-09-28 04:47:51 -05:00
Misc tweaks, sealed classes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
namespace NHSE.WinForms;
|
||||
|
||||
public class USBBotController
|
||||
public sealed class USBBotController
|
||||
{
|
||||
public readonly USBBot Bot = new();
|
||||
|
||||
@@ -20,10 +20,7 @@ public bool Connect()
|
||||
}
|
||||
}
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
Bot.Disconnect();
|
||||
}
|
||||
public void Disconnect() => Bot.Disconnect();
|
||||
|
||||
//todo: this
|
||||
//public uint GetDefaultOffset()
|
||||
|
||||
Reference in New Issue
Block a user