diff --git a/QSB/ItemSync/CustomNomaiRemoteCamera.cs b/QSB/ItemSync/CustomNomaiRemoteCamera.cs index b65834a8..c1e3d62f 100644 --- a/QSB/ItemSync/CustomNomaiRemoteCamera.cs +++ b/QSB/ItemSync/CustomNomaiRemoteCamera.cs @@ -3,7 +3,7 @@ using UnityEngine; namespace QSB.ItemSync { - class CustomNomaiRemoteCamera : MonoBehaviour + internal class CustomNomaiRemoteCamera : MonoBehaviour { private OWCamera _camera; private AudioListener _audioListener; @@ -70,7 +70,7 @@ namespace QSB.ItemSync enabled = false; } - public bool IsActive() + public bool IsActive() => enabled; public void SetImageEffectFade(float fade) diff --git a/QSB/ItemSync/CustomNomaiRemoteCameraPlatform.cs b/QSB/ItemSync/CustomNomaiRemoteCameraPlatform.cs index 965de47f..24d8e75b 100644 --- a/QSB/ItemSync/CustomNomaiRemoteCameraPlatform.cs +++ b/QSB/ItemSync/CustomNomaiRemoteCameraPlatform.cs @@ -8,7 +8,7 @@ using UnityEngine; namespace QSB.ItemSync { - class CustomNomaiRemoteCameraPlatform : NomaiShared + internal class CustomNomaiRemoteCameraPlatform : NomaiShared { private static List s_platforms; private static MaterialPropertyBlock s_matPropBlock; @@ -594,7 +594,7 @@ namespace QSB.ItemSync private void DisconnectCamera() { DebugLog.DebugWrite($"{_oldPlatform.name} DisconnectCamera"); - var cameraState = this._cameraState; + var cameraState = _cameraState; if (cameraState != CameraState.Connected && cameraState != CameraState.Connecting_FadeOut) { if (cameraState == CameraState.Connecting_FadeIn) @@ -692,15 +692,9 @@ namespace QSB.ItemSync return null; } - public SharedStone GetSocketedStone() - { - return _sharedStone; - } + public SharedStone GetSocketedStone() => _sharedStone; - public bool IsPlatformActive() - { - return _platformActive; - } + public bool IsPlatformActive() => _platformActive; public enum CameraState { diff --git a/QSB/ItemSync/CustomNomaiRemoteCameraStreaming.cs b/QSB/ItemSync/CustomNomaiRemoteCameraStreaming.cs index a6662fc0..99046257 100644 --- a/QSB/ItemSync/CustomNomaiRemoteCameraStreaming.cs +++ b/QSB/ItemSync/CustomNomaiRemoteCameraStreaming.cs @@ -1,10 +1,9 @@ using OWML.Utils; -using QSB.Utility; using UnityEngine; namespace QSB.ItemSync { - class CustomNomaiRemoteCameraStreaming : SectoredMonoBehaviour + internal class CustomNomaiRemoteCameraStreaming : SectoredMonoBehaviour { private OWTriggerVolume _owTriggerVolume; public CustomNomaiRemoteCameraPlatform _remoteCameraPlatform diff --git a/QSB/ItemSync/Patches/ItemPatches.cs b/QSB/ItemSync/Patches/ItemPatches.cs index c989ef8b..9a3e6b74 100644 --- a/QSB/ItemSync/Patches/ItemPatches.cs +++ b/QSB/ItemSync/Patches/ItemPatches.cs @@ -33,10 +33,7 @@ namespace QSB.ItemSync.Patches } - public static bool Platform_ReturnFalse() - { - return false; - } + public static bool Platform_ReturnFalse() => false; public static bool ItemTool_MoveItemToCarrySocket(OWItem item) { diff --git a/QSB/QSBInputManager.cs b/QSB/QSBInputManager.cs index 88770ded..93aa03a2 100644 --- a/QSB/QSBInputManager.cs +++ b/QSB/QSBInputManager.cs @@ -1,5 +1,4 @@ -using System; -using UnityEngine; +using UnityEngine; namespace QSB { diff --git a/QSB/QuantumSync/WorldObjects/QSBSocketedQuantumObject.cs b/QSB/QuantumSync/WorldObjects/QSBSocketedQuantumObject.cs index 856c1502..79f44c45 100644 --- a/QSB/QuantumSync/WorldObjects/QSBSocketedQuantumObject.cs +++ b/QSB/QuantumSync/WorldObjects/QSBSocketedQuantumObject.cs @@ -59,7 +59,7 @@ namespace QSB.QuantumSync.WorldObjects component.MoveToRelativeLocation(location, AttachedObject.transform); } - if ((QuantumManager.Instance.Shrine as SocketedQuantumObject) != AttachedObject) + if (QuantumManager.Instance.Shrine != AttachedObject) { AttachedObject.transform.localRotation = message.LocalRotation; } diff --git a/QSB/StatueSync/StatueManager.cs b/QSB/StatueSync/StatueManager.cs index 25f9eff6..cc2a6442 100644 --- a/QSB/StatueSync/StatueManager.cs +++ b/QSB/StatueSync/StatueManager.cs @@ -10,12 +10,12 @@ namespace QSB.StatueSync public bool HasStartedStatueLocally; private void Awake() - { + { Instance = this; QSBSceneManager.OnUniverseSceneLoaded += (OWScene scene) => QSBPlayerManager.ShowAllPlayers(); - } + } - private void OnDestroy() + private void OnDestroy() => QSBSceneManager.OnUniverseSceneLoaded -= (OWScene scene) => QSBPlayerManager.ShowAllPlayers(); public void BeginSequence(Vector3 position, Quaternion rotation, float cameraDegrees) diff --git a/QSB/Utility/GlobalMessenger4Args.cs b/QSB/Utility/GlobalMessenger4Args.cs index ccb4b448..37dd27b3 100644 --- a/QSB/Utility/GlobalMessenger4Args.cs +++ b/QSB/Utility/GlobalMessenger4Args.cs @@ -67,7 +67,7 @@ namespace QSB.Utility } } - private static IDictionary _eventTable = new Dictionary(ComparerLibrary.stringEqComparer); + private static readonly IDictionary _eventTable = new Dictionary(ComparerLibrary.stringEqComparer); private class EventData { diff --git a/QSB/Utility/GlobalMessenger5Args.cs b/QSB/Utility/GlobalMessenger5Args.cs index 3727252d..38fb29dd 100644 --- a/QSB/Utility/GlobalMessenger5Args.cs +++ b/QSB/Utility/GlobalMessenger5Args.cs @@ -67,7 +67,7 @@ namespace QSB.Utility } } - private static IDictionary _eventTable = new Dictionary(ComparerLibrary.stringEqComparer); + private static readonly IDictionary _eventTable = new Dictionary(ComparerLibrary.stringEqComparer); private class EventData { diff --git a/QSB/Utility/GlobalMessenger6Args.cs b/QSB/Utility/GlobalMessenger6Args.cs index c5638433..d1a29e50 100644 --- a/QSB/Utility/GlobalMessenger6Args.cs +++ b/QSB/Utility/GlobalMessenger6Args.cs @@ -67,7 +67,7 @@ namespace QSB.Utility } } - private static IDictionary _eventTable = new Dictionary(ComparerLibrary.stringEqComparer); + private static readonly IDictionary _eventTable = new Dictionary(ComparerLibrary.stringEqComparer); private class EventData { diff --git a/QSB/Utility/Popcron.Gizmos/GizmosInstance.cs b/QSB/Utility/Popcron.Gizmos/GizmosInstance.cs index 21d6971b..65bff7f5 100644 --- a/QSB/Utility/Popcron.Gizmos/GizmosInstance.cs +++ b/QSB/Utility/Popcron.Gizmos/GizmosInstance.cs @@ -141,11 +141,9 @@ namespace Popcron private void OnDisable() => Camera.onPostRender -= OnRendered; - private void Update() - { + private void Update() => //always render something Gizmos.Line(default, default); - } private void OnRendered(Camera camera) { diff --git a/QSB/WorldSync/QSBWorldSync.cs b/QSB/WorldSync/QSBWorldSync.cs index 8f53d4c5..69f86663 100644 --- a/QSB/WorldSync/QSBWorldSync.cs +++ b/QSB/WorldSync/QSBWorldSync.cs @@ -24,7 +24,7 @@ namespace QSB.WorldSync | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly; - private static Dictionary WorldObjectsToUnityObjects = new Dictionary(); + private static readonly Dictionary WorldObjectsToUnityObjects = new Dictionary(); public static IEnumerable GetWorldObjects() => WorldObjects.OfType(); @@ -41,7 +41,7 @@ namespace QSB.WorldSync public static TWorldObject GetWorldFromUnity(TUnityObject unityObject) where TWorldObject : WorldObject - where TUnityObject : MonoBehaviour + where TUnityObject : MonoBehaviour => WorldObjectsToUnityObjects[unityObject] as TWorldObject; public static int GetIdFromUnity(TUnityObject unityObject)