From 441a4d1a3604719bf104a6374a1ffba4e0f39005 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Tue, 15 Jan 2019 17:33:55 -0600 Subject: [PATCH] Refactoring --- .../RecrownedAthenaeum.Pipeline.csproj | 8 ++++++-- .../RecrownedAthenaeum.Tools.csproj | 2 +- .../ResolutionContentResolver.cs | 2 +- .../Pipeline}/NinePatchData.cs | 2 +- .../Pipeline/NinePatchDataReader.cs | 6 +++--- .../Pipeline}/TextureAtlasData.cs | 3 +-- .../Pipeline/TextureAtlasDataReader.cs | 16 ++++++++-------- RecrownedAthenaeum/RecrownedAthenaeum.csproj | 16 ++++++---------- .../ISpecialDrawable.cs | 2 +- .../{DataTypes => SpecialTypes}/NinePatch.cs | 2 +- .../{DataTypes => SpecialTypes}/Resolution.cs | 2 +- .../{DataTypes => SpecialTypes}/TextureAtlas.cs | 2 +- RecrownedAthenaeum/UI/Modular/Modules/Image.cs | 2 +- .../UI/Modular/Modules/Interactive/Button.cs | 2 +- .../UI/Modular/Modules/Interactive/TextButton.cs | 2 +- RecrownedAthenaeum/UI/Skin/Skin.cs | 2 +- 16 files changed, 35 insertions(+), 36 deletions(-) rename {RecrownedAthenaeum.Pipeline/NinePatch => RecrownedAthenaeum/Pipeline}/NinePatchData.cs (96%) rename {RecrownedAthenaeum.Pipeline/TextureAtlas => RecrownedAthenaeum/Pipeline}/TextureAtlasData.cs (96%) rename RecrownedAthenaeum/{DataTypes => SpecialTypes}/ISpecialDrawable.cs (95%) rename RecrownedAthenaeum/{DataTypes => SpecialTypes}/NinePatch.cs (99%) rename RecrownedAthenaeum/{DataTypes => SpecialTypes}/Resolution.cs (97%) rename RecrownedAthenaeum/{DataTypes => SpecialTypes}/TextureAtlas.cs (99%) diff --git a/RecrownedAthenaeum.Pipeline/RecrownedAthenaeum.Pipeline.csproj b/RecrownedAthenaeum.Pipeline/RecrownedAthenaeum.Pipeline.csproj index 4988288..24d3407 100644 --- a/RecrownedAthenaeum.Pipeline/RecrownedAthenaeum.Pipeline.csproj +++ b/RecrownedAthenaeum.Pipeline/RecrownedAthenaeum.Pipeline.csproj @@ -53,17 +53,21 @@ - - + + + {95a926dc-1482-4368-91da-8d30ac04740a} + RecrownedAthenaeum + + \ No newline at end of file diff --git a/RecrownedAthenaeum.Tools/RecrownedAthenaeum.Tools.csproj b/RecrownedAthenaeum.Tools/RecrownedAthenaeum.Tools.csproj index b94566d..fd7a355 100644 --- a/RecrownedAthenaeum.Tools/RecrownedAthenaeum.Tools.csproj +++ b/RecrownedAthenaeum.Tools/RecrownedAthenaeum.Tools.csproj @@ -20,7 +20,7 @@ - + diff --git a/RecrownedAthenaeum/ContentSystem/ContentResolvers/ResolutionContentResolver.cs b/RecrownedAthenaeum/ContentSystem/ContentResolvers/ResolutionContentResolver.cs index fca23f3..7f45ef5 100644 --- a/RecrownedAthenaeum/ContentSystem/ContentResolvers/ResolutionContentResolver.cs +++ b/RecrownedAthenaeum/ContentSystem/ContentResolvers/ResolutionContentResolver.cs @@ -1,4 +1,4 @@ -using RecrownedAthenaeum.DataTypes; +using RecrownedAthenaeum.SpecialTypes; namespace RecrownedAthenaeum.ContentSystem.ContentResolvers { diff --git a/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchData.cs b/RecrownedAthenaeum/Pipeline/NinePatchData.cs similarity index 96% rename from RecrownedAthenaeum.Pipeline/NinePatch/NinePatchData.cs rename to RecrownedAthenaeum/Pipeline/NinePatchData.cs index d2d2560..f88d1b4 100644 --- a/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchData.cs +++ b/RecrownedAthenaeum/Pipeline/NinePatchData.cs @@ -1,6 +1,6 @@ using RecrownedAthenaeum.Pipeline.TextureAtlas; -namespace RecrownedAthenaeum.Pipeline.NinePatch +namespace RecrownedAthenaeum.Pipeline { /// /// Represents a data structure for 9patches. diff --git a/RecrownedAthenaeum/Pipeline/NinePatchDataReader.cs b/RecrownedAthenaeum/Pipeline/NinePatchDataReader.cs index 850f3d3..d6ae01f 100644 --- a/RecrownedAthenaeum/Pipeline/NinePatchDataReader.cs +++ b/RecrownedAthenaeum/Pipeline/NinePatchDataReader.cs @@ -4,14 +4,14 @@ using System.Text; namespace RecrownedAthenaeum.Pipeline { - class NinePatchDataReader : ContentTypeReader + class NinePatchDataReader : ContentTypeReader { - protected override DataTypes.NinePatch Read(ContentReader input, DataTypes.NinePatch existingInstance) + protected override SpecialTypes.NinePatch Read(ContentReader input, SpecialTypes.NinePatch existingInstance) { int length = input.ReadInt32(); byte[] bytes = input.ReadBytes(length); - return JsonConvert.DeserializeObject(Encoding.UTF8.GetString(bytes)); + return JsonConvert.DeserializeObject(Encoding.UTF8.GetString(bytes)); } } } diff --git a/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasData.cs b/RecrownedAthenaeum/Pipeline/TextureAtlasData.cs similarity index 96% rename from RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasData.cs rename to RecrownedAthenaeum/Pipeline/TextureAtlasData.cs index b6da21c..034a3c7 100644 --- a/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasData.cs +++ b/RecrownedAthenaeum/Pipeline/TextureAtlasData.cs @@ -1,7 +1,6 @@ using Microsoft.Xna.Framework; -using RecrownedAthenaeum.Pipeline.NinePatch; -namespace RecrownedAthenaeum.Pipeline.TextureAtlas +namespace RecrownedAthenaeum.Pipeline { /// /// Data transfer object for a texture atlas. diff --git a/RecrownedAthenaeum/Pipeline/TextureAtlasDataReader.cs b/RecrownedAthenaeum/Pipeline/TextureAtlasDataReader.cs index 78ddde1..bcaaaaf 100644 --- a/RecrownedAthenaeum/Pipeline/TextureAtlasDataReader.cs +++ b/RecrownedAthenaeum/Pipeline/TextureAtlasDataReader.cs @@ -7,31 +7,31 @@ using System.Text; namespace RecrownedAthenaeum.Pipeline { - class TextureAtlasDataReader : ContentTypeReader + class TextureAtlasDataReader : ContentTypeReader { - protected override DataTypes.TextureAtlas Read(ContentReader input, DataTypes.TextureAtlas existingInstance) + protected override SpecialTypes.TextureAtlas Read(ContentReader input, SpecialTypes.TextureAtlas existingInstance) { string serialized = input.ReadString(); TextureAtlasData atlasData = JsonConvert.DeserializeObject(serialized); - DataTypes.TextureAtlas atlas; + SpecialTypes.TextureAtlas atlas; Texture2D atlasTexture = input.ContentManager.Load(atlasData.textureName); - DataTypes.TextureAtlas.TextureAtlasRegion[] regions = new DataTypes.TextureAtlas.TextureAtlasRegion[atlasData.regions.Length]; + SpecialTypes.TextureAtlas.TextureAtlasRegion[] regions = new SpecialTypes.TextureAtlas.TextureAtlasRegion[atlasData.regions.Length]; for (int regionID = 0; regionID < regions.Length; regionID++) { TextureAtlasData.AtlasRegionData regionData = atlasData.regions[regionID]; - DataTypes.NinePatch nPatch = null; + SpecialTypes.NinePatch nPatch = null; if (regionData.ninePatchData != null) { NinePatchData nPatchData = regionData.ninePatchData; - nPatch = new DataTypes.NinePatch(atlasTexture, nPatchData.left, nPatchData.right, nPatchData.bottom, nPatchData.bottom); + nPatch = new SpecialTypes.NinePatch(atlasTexture, nPatchData.left, nPatchData.right, nPatchData.bottom, nPatchData.bottom); } - regions[regionID] = new DataTypes.TextureAtlas.TextureAtlasRegion(regionData.name, regionData.location, nPatch, atlasTexture); + regions[regionID] = new SpecialTypes.TextureAtlas.TextureAtlasRegion(regionData.name, regionData.location, nPatch, atlasTexture); } - atlas = new DataTypes.TextureAtlas(atlasTexture, regions); + atlas = new SpecialTypes.TextureAtlas(atlasTexture, regions); return atlas; } diff --git a/RecrownedAthenaeum/RecrownedAthenaeum.csproj b/RecrownedAthenaeum/RecrownedAthenaeum.csproj index 66a6287..3dd30f5 100644 --- a/RecrownedAthenaeum/RecrownedAthenaeum.csproj +++ b/RecrownedAthenaeum/RecrownedAthenaeum.csproj @@ -58,16 +58,18 @@ - - - - + + + + + + @@ -94,11 +96,5 @@ - - - {b38f9812-b1d1-4bfe-89ee-fc4dd4ebaa3f} - RecrownedAthenaeum.Pipeline - - \ No newline at end of file diff --git a/RecrownedAthenaeum/DataTypes/ISpecialDrawable.cs b/RecrownedAthenaeum/SpecialTypes/ISpecialDrawable.cs similarity index 95% rename from RecrownedAthenaeum/DataTypes/ISpecialDrawable.cs rename to RecrownedAthenaeum/SpecialTypes/ISpecialDrawable.cs index 7866c3a..00585a1 100644 --- a/RecrownedAthenaeum/DataTypes/ISpecialDrawable.cs +++ b/RecrownedAthenaeum/SpecialTypes/ISpecialDrawable.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace RecrownedAthenaeum.DataTypes +namespace RecrownedAthenaeum.SpecialTypes { /// /// A wrapper that makes sure anything implementing can be drawn with options. diff --git a/RecrownedAthenaeum/DataTypes/NinePatch.cs b/RecrownedAthenaeum/SpecialTypes/NinePatch.cs similarity index 99% rename from RecrownedAthenaeum/DataTypes/NinePatch.cs rename to RecrownedAthenaeum/SpecialTypes/NinePatch.cs index 8656d08..1964258 100644 --- a/RecrownedAthenaeum/DataTypes/NinePatch.cs +++ b/RecrownedAthenaeum/SpecialTypes/NinePatch.cs @@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Graphics; using System; -namespace RecrownedAthenaeum.DataTypes +namespace RecrownedAthenaeum.SpecialTypes { /// /// An object that represents a ninepatch. diff --git a/RecrownedAthenaeum/DataTypes/Resolution.cs b/RecrownedAthenaeum/SpecialTypes/Resolution.cs similarity index 97% rename from RecrownedAthenaeum/DataTypes/Resolution.cs rename to RecrownedAthenaeum/SpecialTypes/Resolution.cs index da32304..ecd0c1e 100644 --- a/RecrownedAthenaeum/DataTypes/Resolution.cs +++ b/RecrownedAthenaeum/SpecialTypes/Resolution.cs @@ -1,6 +1,6 @@ using System; -namespace RecrownedAthenaeum.DataTypes +namespace RecrownedAthenaeum.SpecialTypes { /// /// Holds a width and height while allowing for easier comparison between other s. diff --git a/RecrownedAthenaeum/DataTypes/TextureAtlas.cs b/RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs similarity index 99% rename from RecrownedAthenaeum/DataTypes/TextureAtlas.cs rename to RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs index d675c68..5206cb1 100644 --- a/RecrownedAthenaeum/DataTypes/TextureAtlas.cs +++ b/RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; -namespace RecrownedAthenaeum.DataTypes +namespace RecrownedAthenaeum.SpecialTypes { /// /// Holds information about an image file that contains various textures in various regions in the file. diff --git a/RecrownedAthenaeum/UI/Modular/Modules/Image.cs b/RecrownedAthenaeum/UI/Modular/Modules/Image.cs index 4eae7f8..dba5e22 100644 --- a/RecrownedAthenaeum/UI/Modular/Modules/Image.cs +++ b/RecrownedAthenaeum/UI/Modular/Modules/Image.cs @@ -1,6 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using RecrownedAthenaeum.DataTypes; +using RecrownedAthenaeum.SpecialTypes; using System; namespace RecrownedAthenaeum.UI.Modular.Modules diff --git a/RecrownedAthenaeum/UI/Modular/Modules/Interactive/Button.cs b/RecrownedAthenaeum/UI/Modular/Modules/Interactive/Button.cs index 77b8fa7..d39a3bb 100644 --- a/RecrownedAthenaeum/UI/Modular/Modules/Interactive/Button.cs +++ b/RecrownedAthenaeum/UI/Modular/Modules/Interactive/Button.cs @@ -1,6 +1,6 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using RecrownedAthenaeum.DataTypes; +using RecrownedAthenaeum.SpecialTypes; using RecrownedAthenaeum.Input; using RecrownedAthenaeum.UI.Skin.Definitions; diff --git a/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs b/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs index 4504e2d..0c06afb 100644 --- a/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs +++ b/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs @@ -1,6 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using RecrownedAthenaeum.DataTypes; +using RecrownedAthenaeum.SpecialTypes; using RecrownedAthenaeum.UI.Skin.Definitions; namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive diff --git a/RecrownedAthenaeum/UI/Skin/Skin.cs b/RecrownedAthenaeum/UI/Skin/Skin.cs index 6c598cf..c4a46e5 100644 --- a/RecrownedAthenaeum/UI/Skin/Skin.cs +++ b/RecrownedAthenaeum/UI/Skin/Skin.cs @@ -1,6 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using RecrownedAthenaeum.DataTypes; +using RecrownedAthenaeum.SpecialTypes; using RecrownedAthenaeum.UI.Skin.Definitions; using System; using System.Collections.Generic;