Automatic code cleanup (no real changes)

- Use explicit type of var
- Use 'new()'
- Remove unnecessary usings
- Sort usings
- Apply formatting
This commit is contained in:
Sinai
2022-04-12 05:20:35 +10:00
parent 693f5818be
commit 7e0f98ef91
95 changed files with 732 additions and 1073 deletions

View File

@ -2,8 +2,6 @@
using BepInEx.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityExplorer.Config;
namespace UnityExplorer.Loader.BIE
@ -21,7 +19,7 @@ namespace UnityExplorer.Loader.BIE
public override void RegisterConfigElement<T>(ConfigElement<T> config)
{
var entry = Config.Bind(CTG_NAME, config.Name, config.Value, config.Description);
ConfigEntry<T> entry = Config.Bind(CTG_NAME, config.Name, config.Value, config.Description);
entry.SettingChanged += (object o, EventArgs e) =>
{
@ -47,13 +45,13 @@ namespace UnityExplorer.Loader.BIE
public override void LoadConfig()
{
foreach (var entry in ConfigManager.ConfigElements)
foreach (KeyValuePair<string, IConfigElement> entry in ConfigManager.ConfigElements)
{
var key = entry.Key;
var def = new ConfigDefinition(CTG_NAME, key);
string key = entry.Key;
ConfigDefinition def = new(CTG_NAME, key);
if (Config.ContainsKey(def) && Config[def] is ConfigEntryBase configEntry)
{
var config = entry.Value;
IConfigElement config = entry.Value;
config.BoxedValue = configEntry.BoxedValue;
}
}

View File

@ -3,14 +3,8 @@ using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityExplorer.Config;
using UniverseLib.Input;
using UnityExplorer.Loader.BIE;
#if CPP
using BepInEx.IL2CPP;
@ -45,7 +39,7 @@ namespace UnityExplorer
public Harmony HarmonyInstance => s_harmony;
private static readonly Harmony s_harmony = new(ExplorerCore.GUID);
public string ExplorerFolderName => ExplorerCore.DEFAULT_EXPLORER_FOLDER_NAME;
public string ExplorerFolderDestination => Paths.PluginPath;

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityExplorer.Config;
namespace UnityExplorer