From e3b38a70f8d710af07732b325a6013ed18aa0fb0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 25 Aug 2021 19:17:29 -0400 Subject: [PATCH] reorganize new classes --- src/SMAPI/Framework/ModLoading/AssemblyLoader.cs | 1 + .../{MySymbolReader.cs => Symbols/SymbolReader.cs} | 12 ++++-------- .../ModLoading/{ => Symbols}/SymbolReaderProvider.cs | 8 +++----- .../ModLoading/{ => Symbols}/SymbolWriterProvider.cs | 5 +---- 4 files changed, 9 insertions(+), 17 deletions(-) rename src/SMAPI/Framework/ModLoading/{MySymbolReader.cs => Symbols/SymbolReader.cs} (78%) rename src/SMAPI/Framework/ModLoading/{ => Symbols}/SymbolReaderProvider.cs (80%) rename src/SMAPI/Framework/ModLoading/{ => Symbols}/SymbolWriterProvider.cs (85%) diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs index 98154b53..72cfd119 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs @@ -7,6 +7,7 @@ using Mono.Cecil; using Mono.Cecil.Cil; using StardewModdingAPI.Framework.Exceptions; using StardewModdingAPI.Framework.ModLoading.Framework; +using StardewModdingAPI.Framework.ModLoading.Symbols; using StardewModdingAPI.Metadata; using StardewModdingAPI.Toolkit.Framework.ModData; using StardewModdingAPI.Toolkit.Utilities; diff --git a/src/SMAPI/Framework/ModLoading/MySymbolReader.cs b/src/SMAPI/Framework/ModLoading/Symbols/SymbolReader.cs similarity index 78% rename from src/SMAPI/Framework/ModLoading/MySymbolReader.cs rename to src/SMAPI/Framework/ModLoading/Symbols/SymbolReader.cs index 215631c6..f1ae86a2 100644 --- a/src/SMAPI/Framework/ModLoading/MySymbolReader.cs +++ b/src/SMAPI/Framework/ModLoading/Symbols/SymbolReader.cs @@ -1,22 +1,18 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Mono.Cecil; using Mono.Cecil.Cil; using Mono.Cecil.Pdb; -namespace StardewModdingAPI.Framework.ModLoading +namespace StardewModdingAPI.Framework.ModLoading.Symbols { - internal class MySymbolReader : ISymbolReader + internal class SymbolReader : ISymbolReader { private ModuleDefinition Module; private Stream Stream; private ISymbolReader Using; - public MySymbolReader( ModuleDefinition module, Stream stream ) + public SymbolReader( ModuleDefinition module, Stream stream ) { this.Module = module; this.Stream = stream; @@ -49,7 +45,7 @@ namespace StardewModdingAPI.Framework.ModLoading public MethodDebugInformation Read( MethodDefinition method ) { - return Using.Read( method ); + return this.Using.Read( method ); } } } diff --git a/src/SMAPI/Framework/ModLoading/SymbolReaderProvider.cs b/src/SMAPI/Framework/ModLoading/Symbols/SymbolReaderProvider.cs similarity index 80% rename from src/SMAPI/Framework/ModLoading/SymbolReaderProvider.cs rename to src/SMAPI/Framework/ModLoading/Symbols/SymbolReaderProvider.cs index c92e1e4d..e2a6d21e 100644 --- a/src/SMAPI/Framework/ModLoading/SymbolReaderProvider.cs +++ b/src/SMAPI/Framework/ModLoading/Symbols/SymbolReaderProvider.cs @@ -1,11 +1,9 @@ -using System; using System.Collections.Generic; using System.IO; using Mono.Cecil; using Mono.Cecil.Cil; -using Mono.Cecil.Pdb; -namespace StardewModdingAPI.Framework.ModLoading +namespace StardewModdingAPI.Framework.ModLoading.Symbols { internal class SymbolReaderProvider : ISymbolReaderProvider { @@ -21,7 +19,7 @@ namespace StardewModdingAPI.Framework.ModLoading public ISymbolReader GetSymbolReader( ModuleDefinition module, string fileName ) { if ( this.SymbolMapping.ContainsKey( module.Name ) ) - return new MySymbolReader( module, this.SymbolMapping[ module.Name ] ); + return new SymbolReader( module, this.SymbolMapping[ module.Name ] ); return this.BaseProvider.GetSymbolReader( module, fileName ); } @@ -29,7 +27,7 @@ namespace StardewModdingAPI.Framework.ModLoading public ISymbolReader GetSymbolReader( ModuleDefinition module, Stream symbolStream ) { if ( this.SymbolMapping.ContainsKey( module.Name ) ) - return new MySymbolReader( module, this.SymbolMapping[ module.Name ] ); + return new SymbolReader( module, this.SymbolMapping[ module.Name ] ); return this.BaseProvider.GetSymbolReader( module, symbolStream ); } diff --git a/src/SMAPI/Framework/ModLoading/SymbolWriterProvider.cs b/src/SMAPI/Framework/ModLoading/Symbols/SymbolWriterProvider.cs similarity index 85% rename from src/SMAPI/Framework/ModLoading/SymbolWriterProvider.cs rename to src/SMAPI/Framework/ModLoading/Symbols/SymbolWriterProvider.cs index 116e341a..33e91db0 100644 --- a/src/SMAPI/Framework/ModLoading/SymbolWriterProvider.cs +++ b/src/SMAPI/Framework/ModLoading/Symbols/SymbolWriterProvider.cs @@ -1,11 +1,8 @@ -using System; -using System.Collections.Generic; using System.IO; using Mono.Cecil; using Mono.Cecil.Cil; -using Mono.Cecil.Pdb; -namespace StardewModdingAPI.Framework.ModLoading +namespace StardewModdingAPI.Framework.ModLoading.Symbols { internal class SymbolWriterProvider : ISymbolWriterProvider {