Skip to content

Commit

Permalink
code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
GrafDimenzio committed Oct 20, 2021
1 parent 524940f commit 99ec90d
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Pets/Commands/MyPetCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions Pets/Pet.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions Pets/PetConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Synapse.Config;
using System.Collections.Generic;
using System.Collections.Generic;
using Synapse.Config;

namespace Pets
{
Expand Down
12 changes: 6 additions & 6 deletions Pets/PetHandler.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
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<PetConfiguration> Pets { get; } = new List<PetConfiguration>();
internal List<PetConfiguration> Pets { get; } = new List<PetConfiguration>();

[API]
public PetConfiguration GetPet(int ID) => Pets.FirstOrDefault(x => x.PetID == ID);

[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");
Expand Down
4 changes: 2 additions & 2 deletions Pets/PetOwnerScript.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using UnityEngine;
using System.Collections.Generic;
using System.Collections.Generic;
using UnityEngine;

namespace Pets
{
Expand Down
6 changes: 3 additions & 3 deletions Pets/PluginClass.cs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions Pets/PluginConfig.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
4 changes: 2 additions & 2 deletions Pets/PluginExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Synapse.Api;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Synapse.Api;

namespace Pets
{
Expand Down
12 changes: 6 additions & 6 deletions Pets/PluginPatches.cs
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 99ec90d

Please sign in to comment.