public Texture GetTexture(string textureType, string name) { if (TexturesDictionary.ContainsKey(textureType)) { if (TexturesDictionary[textureType].ContainsKey(name)) { return(TexturesDictionary[textureType][name]); } else { throw new ArgumentException("Couldn not find texture with this name", "name"); } } else { throw new ArgumentException("There are no textures of this type", "textureType"); } }
public string GetNameFromTexture(string textureType, Texture texture) { if (TexturesDictionary.ContainsKey(textureType)) { foreach (KeyValuePair <string, Texture> StringTexturePair in TexturesDictionary[textureType]) { if (StringTexturePair.Value == texture) { return(StringTexturePair.Key); } } throw new ArgumentException("Could not find given texture", "texture"); } else { throw new ArgumentException("There are no textures of this type", "textureType"); } }