From 4b90db389d08290d892eeba30ca71e0b5b39f9f9 Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 13 Jan 2024 23:54:15 +0100 Subject: [PATCH] Added list of shockerIds to abstract class Shocker --- OpenCS2hock/Shocker.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/OpenCS2hock/Shocker.cs b/OpenCS2hock/Shocker.cs index 2cb9355..e40177b 100644 --- a/OpenCS2hock/Shocker.cs +++ b/OpenCS2hock/Shocker.cs @@ -2,13 +2,20 @@ public abstract class Shocker { - public string ApiKey, Endpoint; - public enum ControlAction { Beep, Vibrate, Shock } - public abstract void Control(ControlAction action, byte intensity, short duration); + protected readonly HttpClient HttpClient; + protected readonly string ApiKey; + protected readonly string Endpoint; + protected string[] ShockerIds; - public Shocker(string endpoint, string apiKey) + public enum ControlAction { Beep, Vibrate, Shock } + + public abstract void Control(ControlAction action, byte intensity, short duration, string? shockerId = null); + + protected Shocker(string endpoint, string apiKey, string[] shockerIds) { this.Endpoint = endpoint; this.ApiKey = apiKey; + this.HttpClient = new HttpClient(); + this.ShockerIds = shockerIds; } } \ No newline at end of file