From a27df5a28721d6d4952c56fa713ebb64f97a3a77 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Tue, 15 Jan 2019 19:34:47 -0600 Subject: [PATCH] refactors. --- .../SpecialTypes/TextureAtlas.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs b/RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs index 5206cb1..3673909 100644 --- a/RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs +++ b/RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs @@ -13,24 +13,24 @@ namespace RecrownedAthenaeum.SpecialTypes { private Texture2D texture; private bool disposed; - private Dictionary dictionaryOfRegions = new Dictionary(); + private Dictionary dictionaryOfRegions = new Dictionary(); /// - /// Given a name, can return a . + /// Given a name, can return a . /// - /// Name of to obtain. - /// based off name. - public TextureAtlasRegion this[string name] { get { if (name != null && dictionaryOfRegions.ContainsKey(name)) return dictionaryOfRegions[name]; else return null; } } + /// Name of to obtain. + /// based off name. + public Region this[string name] { get { if (name != null && dictionaryOfRegions.ContainsKey(name)) return dictionaryOfRegions[name]; else return null; } } /// - /// Creates a texture atlas with given main texture as well as an array of to represent locations of which textures reside within the atlas. Region names will be used to refer to the regions within the dictionary. + /// Creates a texture atlas with given main texture as well as an array of to represent locations of which textures reside within the atlas. Region names will be used to refer to the regions within the dictionary. /// /// The texture representing the overall atlas. /// The sub regions that represent the individual textures. - public TextureAtlas(Texture2D texture, TextureAtlasRegion[] regions) + public TextureAtlas(Texture2D texture, Region[] regions) { this.texture = texture; - foreach (TextureAtlasRegion region in regions) + foreach (Region region in regions) { dictionaryOfRegions.Add(region.name, region); } @@ -41,7 +41,7 @@ namespace RecrownedAthenaeum.SpecialTypes /// /// The texture representing the overall atlas. /// - public TextureAtlas(Texture2D texture, Dictionary dictionaryOfRegions) + public TextureAtlas(Texture2D texture, Dictionary dictionaryOfRegions) { this.texture = texture; this.dictionaryOfRegions = dictionaryOfRegions; @@ -109,7 +109,7 @@ namespace RecrownedAthenaeum.SpecialTypes /// /// A region of a . /// - public class TextureAtlasRegion : IComparable, ISpecialDrawable, IDisposable + public class Region : IComparable, ISpecialDrawable, IDisposable { /// /// The name of the region. Mostly used to be refered to within the context of a . @@ -132,7 +132,7 @@ namespace RecrownedAthenaeum.SpecialTypes /// The location of the region on the atlas. /// A definition for the region. /// The texture that holds the image data for the atlas. - public TextureAtlasRegion(string name, Rectangle sourceRegion, NinePatch ninePatch, Texture2D atlasTexture) + public Region(string name, Rectangle sourceRegion, NinePatch ninePatch, Texture2D atlasTexture) { this.atlasTexture = atlasTexture ?? throw new ArgumentNullException("Name parameters can be null."); this.name = name ?? throw new ArgumentNullException("Name parameters can be null."); @@ -185,7 +185,7 @@ namespace RecrownedAthenaeum.SpecialTypes /// /// The other region to compare to in terms of name. /// Less than one if precedes, greater than one if after, 0 if same. - public int CompareTo(TextureAtlasRegion other) + public int CompareTo(Region other) { return name.CompareTo(other); } @@ -216,7 +216,7 @@ namespace RecrownedAthenaeum.SpecialTypes /// /// Destructor. /// - ~TextureAtlasRegion() + ~Region() { Dispose(false); }