From 99ec90d2ef848062e5c02bbcf42551408e9ab507 Mon Sep 17 00:00:00 2001 From: GrafDimenzio Date: Wed, 20 Oct 2021 09:44:18 +0200 Subject: [PATCH] code clean up --- Pets/Commands/MyPetCommand.cs | 2 +- Pets/Pet.cs | 6 +++--- Pets/PetConfiguration.cs | 4 ++-- Pets/PetHandler.cs | 12 ++++++------ Pets/PetOwnerScript.cs | 4 ++-- Pets/PluginClass.cs | 6 +++--- Pets/PluginConfig.cs | 12 ++++++------ Pets/PluginExtensions.cs | 4 ++-- Pets/PluginPatches.cs | 12 ++++++------ 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Pets/Commands/MyPetCommand.cs b/Pets/Commands/MyPetCommand.cs index 92b6f2d..7d5a096 100644 --- a/Pets/Commands/MyPetCommand.cs +++ b/Pets/Commands/MyPetCommand.cs @@ -44,7 +44,7 @@ public CommandResult Execute(CommandContext context) }; - if (Pet.SpawnPet(context.Player, result, out var pet)) + if (Pet.SpawnPet(context.Player, result, out _)) return new CommandResult { Message = PluginClass.PetPlugin.Translation.ActiveTranslation.Spawned, diff --git a/Pets/Pet.cs b/Pets/Pet.cs index 933a7ba..ba93e89 100644 --- a/Pets/Pet.cs +++ b/Pets/Pet.cs @@ -1,8 +1,8 @@ -using Synapse.Api; +using System.Collections.Generic; +using System.Linq; using MEC; -using System.Collections.Generic; +using Synapse.Api; using UnityEngine; -using System.Linq; namespace Pets { diff --git a/Pets/PetConfiguration.cs b/Pets/PetConfiguration.cs index 094ed44..3b65cf5 100644 --- a/Pets/PetConfiguration.cs +++ b/Pets/PetConfiguration.cs @@ -1,5 +1,5 @@ -using Synapse.Config; -using System.Collections.Generic; +using System.Collections.Generic; +using Synapse.Config; namespace Pets { diff --git a/Pets/PetHandler.cs b/Pets/PetHandler.cs index 7ef967e..78d05db 100644 --- a/Pets/PetHandler.cs +++ b/Pets/PetHandler.cs @@ -1,16 +1,16 @@ -using System.Collections.Generic; -using System.Linq; -using Synapse.Api; +using System; +using System.Collections.Generic; using System.IO; +using System.Linq; using Synapse; -using System; +using Synapse.Api; using Synapse.Config; namespace Pets { public class PetHandler { - public List Pets { get; } = new List(); + internal List Pets { get; } = new List(); [API] public PetConfiguration GetPet(int ID) => Pets.FirstOrDefault(x => x.PetID == ID); @@ -18,7 +18,7 @@ public class PetHandler [API] public bool PetIsRegistered(int ID) => Pets.Any(x => x.PetID == ID); - public void LoadPets() + internal void LoadPets() { var spath = Path.Combine(Server.Get.Files.SharedConfigDirectory, "pets"); var path = Path.Combine(Server.Get.Files.ConfigDirectory, "pets"); diff --git a/Pets/PetOwnerScript.cs b/Pets/PetOwnerScript.cs index 0cc0d82..bcad991 100644 --- a/Pets/PetOwnerScript.cs +++ b/Pets/PetOwnerScript.cs @@ -1,5 +1,5 @@ -using UnityEngine; -using System.Collections.Generic; +using System.Collections.Generic; +using UnityEngine; namespace Pets { diff --git a/Pets/PluginClass.cs b/Pets/PluginClass.cs index 35cce0c..bf2d6c9 100644 --- a/Pets/PluginClass.cs +++ b/Pets/PluginClass.cs @@ -1,7 +1,7 @@ -using HarmonyLib; -using System; -using Synapse.Api.Plugin; +using System; +using HarmonyLib; using Synapse.Api; +using Synapse.Api.Plugin; using Synapse.Translation; namespace Pets diff --git a/Pets/PluginConfig.cs b/Pets/PluginConfig.cs index de4d013..f66a868 100644 --- a/Pets/PluginConfig.cs +++ b/Pets/PluginConfig.cs @@ -1,20 +1,20 @@ -using Synapse.Config; -using System.ComponentModel; +using System.ComponentModel; +using Synapse.Config; namespace Pets { public class PluginConfig : AbstractConfigSection { [Description("The max Amount of Pets a Player can have at the same time")] - public int MaxPets = 1; + public int MaxPets { get; set; } = 1; [Description("If enabled only the Owner of the pet can see it")] - public bool InvisiblePet = false; + public bool InvisiblePet { get; set; } = false; [Description("If Enabled the Name of the Owner will also be displayed")] - public bool ShowOwnerName = true; + public bool ShowOwnerName { get; set; } = true; [Description("If Disabled the Role of the Pet will no longer be displayed")] - public bool ShowRole = false; + public bool ShowRole { get; set; } = false; } } diff --git a/Pets/PluginExtensions.cs b/Pets/PluginExtensions.cs index 5837a2b..e99cc38 100644 --- a/Pets/PluginExtensions.cs +++ b/Pets/PluginExtensions.cs @@ -1,6 +1,6 @@ -using Synapse.Api; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; +using Synapse.Api; namespace Pets { diff --git a/Pets/PluginPatches.cs b/Pets/PluginPatches.cs index af5e25e..fc8888c 100644 --- a/Pets/PluginPatches.cs +++ b/Pets/PluginPatches.cs @@ -1,15 +1,15 @@ using System; +using System.Collections.Generic; using System.Linq; -using Synapse; -using Synapse.Api; +using System.Text; using HarmonyLib; using Respawning.NamingRules; -using System.Text; -using System.Collections.Generic; +using Synapse; +using Synapse.Api; namespace Pets { - [HarmonyPatch(typeof(NineTailedFoxNamingRule), nameof(NineTailedFoxNamingRule.PlayEntranceAnnouncement))] + [HarmonyPatch(typeof(NineTailedFoxNamingRule), nameof(NineTailedFoxNamingRule.PlayEntranceAnnouncement))] internal static class AnnouncePatch { private static bool Prefix(NineTailedFoxNamingRule __instance, string regular) @@ -19,7 +19,7 @@ private static bool Prefix(NineTailedFoxNamingRule __instance, string regular) string cassieUnitName = __instance.GetCassieUnitName(regular); int num = Server.Get.GetPlayers(x => x.RealTeam == Team.SCP && !x.IsDummy).Count; StringBuilder stringBuilder = new StringBuilder(); - if (global::ClutterSpawner.IsHolidayActive(global::Holidays.Christmas)) + if (ClutterSpawner.IsHolidayActive(Holidays.Christmas)) { stringBuilder.Append("XMAS_EPSILON11 "); stringBuilder.Append(cassieUnitName);