Format whitespaces

This commit is contained in:
js6pak committed 2022-10-07 14:55:14 +02:00
1 parent b7971d36a8
commit 81eea3eee2
21 files changed
+26 -27

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
using BenchmarkDotNet.Running;
using BepInEx;
using BepInEx.Unity.IL2CPP;
+1 -1
View File
@@ -1,4 +1,4 @@
using System;
using System;
using BepInEx;
using BepInEx.Unity.IL2CPP;
using Il2CppInterop.Runtime.Attributes;
@@ -11,7 +11,7 @@ namespace Reactor.Networking.Attributes;
public class MessageConverterAttribute : Attribute
{
private static readonly HashSet<Assembly> _registeredAssemblies = new();
public static void Register(Assembly assembly)
{
if (_registeredAssemblies.Contains(assembly)) return;
@@ -21,7 +21,7 @@ public class ReactorModFlagsAttribute : Attribute
{
return attribute.Flags;
}
var metadataAttribute = type.Assembly.GetCustomAttributes<AssemblyMetadataAttribute>().SingleOrDefault(x => x.Key == "Reactor.ModFlags");
if (metadataAttribute is { Value: not null })
{
+1 -1
View File
@@ -120,7 +120,7 @@ public static class ModList
foreach (var existingPlugin in IL2CPPChainloader.Instance.Plugins.Values)
{
if (existingPlugin.Instance == null) continue;
OnPluginLoad(existingPlugin, (BasePlugin)existingPlugin.Instance);
OnPluginLoad(existingPlugin, (BasePlugin) existingPlugin.Instance);
}
IL2CPPChainloader.Instance.PluginLoad += (pluginInfo, _, plugin) => OnPluginLoad(pluginInfo, plugin);
+1 -2
View File
@@ -6,7 +6,6 @@ using Il2CppInterop.Runtime.InteropTypes.Arrays;
using InnerNet;
using Reactor.Networking.Extensions;
using Reactor.Networking.Messages;
using Reactor.Networking.Serialization;
using UnityEngine;
namespace Reactor.Networking.Patches;
@@ -183,7 +182,7 @@ internal static class ClientPatches
msg.Write((byte) flags);
InnerNetObject[] componentsInChildren = netObjParent.GetComponentsInChildren<InnerNetObject>();
msg.WritePacked(componentsInChildren.Length);
foreach (InnerNetObject innerNetObject in componentsInChildren)
foreach (var innerNetObject in componentsInChildren)
{
innerNetObject.OwnerId = ownerId;
innerNetObject.SpawnFlags = flags;
+1 -1
View File
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Linq;
using System.Reflection;
+1 -1
View File
@@ -1,4 +1,4 @@
using System;
using System;
namespace Reactor.Networking.Rpc;
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Reactor.Networking.Rpc;
namespace Reactor.Networking.Rpc;
public enum RpcLocalHandling
{
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using HarmonyLib;
+2 -2
View File
@@ -1,12 +1,12 @@
global using static Reactor.Utilities.Logger<Reactor.ReactorPlugin>;
global using static Reactor.Utilities.Logger<Reactor.ReactorPlugin>;
using System;
using System.Linq;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Reactor.Networking;
using Il2CppInterop.Runtime.Attributes;
using Reactor.Networking;
using Reactor.Networking.Attributes;
using Reactor.Networking.Rpc;
using Reactor.Patches;
@@ -11,7 +11,7 @@ namespace Reactor.Utilities.Attributes;
/// Utility attribute for automatically calling <see cref="ClassInjector.RegisterTypeInIl2Cpp{T}()"/>
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class RegisterInIl2CppAttribute : Attribute
public sealed class RegisterInIl2CppAttribute : Attribute
{
private static readonly HashSet<Assembly> _registeredAssemblies = new();
@@ -58,7 +58,7 @@ public class RegisterInIl2CppAttribute : Attribute
{
if (_registeredAssemblies.Contains(assembly)) return;
_registeredAssemblies.Add(assembly);
foreach (var type in assembly.GetTypes())
{
var attribute = type.GetCustomAttribute<RegisterInIl2CppAttribute>();
+2 -2
View File
@@ -1,4 +1,4 @@
using System;
using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
@@ -32,7 +32,7 @@ public static class CanvasUtilities
return gameObject;
}
/// <summary>
/// Shortcut for empty texture
/// </summary>
@@ -1,4 +1,4 @@
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime;
using UnityEngine;
namespace Reactor.Utilities.Extensions;
@@ -20,7 +20,7 @@ public static class RandomExtensions
{
return random.NextDouble() * (maxValue - minValue) + minValue;
}
/// <summary>
/// Returns random <typeparamref name="T"/> from <paramref name="input"/>
/// </summary>
@@ -8,9 +8,9 @@ using Il2CppInterop.Common.Attributes;
using Il2CppInterop.Runtime;
using Il2CppSystem.Runtime.CompilerServices;
using Il2CppCustomAttributeExtensions = Il2CppSystem.Reflection.CustomAttributeExtensions;
using MethodInfo = System.Reflection.MethodInfo;
using Il2CppMethodInfo = Il2CppSystem.Reflection.MethodInfo;
using Il2CppSystemType = Il2CppSystem.Type;
using MethodInfo = System.Reflection.MethodInfo;
namespace Reactor.Utilities.Extensions;
@@ -55,7 +55,7 @@ public static class ReflectionExtensions
{
return AccessTools.Method(AccessTools.Method(type, methodName).ToIl2CppMethodInfo().GetEnumeratorMoveNextType().ToSystemType(), "MoveNext");
}
public static IEnumerable<MethodBase> GetMethods(this Type type, BindingFlags bindingAttr, Type returnType, params Type[] parameterTypes)
{
return type.GetMethods(bindingAttr).Where(x => x.ReturnType == returnType && x.GetParameters().Select(x => x.ParameterType).SequenceEqual(parameterTypes));
@@ -90,7 +90,7 @@ public static class StreamExtensions
/// Wraps a System Stream into an Il2Cpp Stream
/// </summary>
public static StreamWrapper AsIl2Cpp(this Stream stream) => new(stream);
/// <summary>
/// Fully read <paramref name="input"/> stream, can be used as workaround for il2cpp streams.
/// </summary>
@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
namespace Reactor.Utilities.Extensions;
+1 -1
View File
@@ -1,4 +1,4 @@
using System;
using System;
using Reactor.Utilities.Extensions;
using UnityEngine;
+1 -1
View File
@@ -1,4 +1,4 @@
using System;
using System;
using Reactor.Utilities.Extensions;
using UnityEngine;
+2 -2
View File
@@ -10,11 +10,11 @@ public static class Logger<T> where T : BasePlugin
public static ManualLogSource Instance => PluginSingleton<T>.Instance.Log;
/// <inheritdoc cref="ManualLogSource.Log(BepInEx.Logging.LogLevel,object)"/>
public static void Log(LogLevel level, object data) => Instance.Log(level,data);
public static void Log(LogLevel level, object data) => Instance.Log(level, data);
/// <inheritdoc cref="ManualLogSource.LogFatal(object)"/>
public static void Log(LogLevel level, [InterpolatedStringHandlerArgument("level")] BepInExLogInterpolatedStringHandler logHandler) => Instance.Log(level, logHandler);
/// <inheritdoc cref="ManualLogSource.LogFatal(object)"/>
public static void Fatal(object data) => Instance.LogFatal(data);