From ff2e0b479fb31074fda122781745dc8d11dc8af5 Mon Sep 17 00:00:00 2001 From: Recrown Date: Tue, 29 Jan 2019 15:55:56 -0600 Subject: [PATCH] Added a function to check for the existence of a region. --- RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs b/RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs index 99c8984..6d8af5c 100644 --- a/RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs +++ b/RecrownedAthenaeum/SpecialTypes/TextureAtlas.cs @@ -73,6 +73,16 @@ namespace RecrownedAthenaeum.SpecialTypes return dictionaryOfRegions[name].AsTexture2D(graphicsDevice); } + /// + /// Whether or not this atlas contains the given region name. + /// + /// The name of the region to check for. + /// True if this atlas does contain the region given by name. + public bool ContainsRegion(string regionName) + { + return dictionaryOfRegions.ContainsKey(regionName); + } + /// /// Disposes unmanaged resources for the texture atlas. ///