Example:
Dictionary
<string, Texture2D> textures = new Dictionary<string, Texture2D>();Except dictionary doesn't accomplish this. There are so many list type classes that I'm finding them quite confusing to keep track of, but from what I think I've surmised, it doesn't seem like theres a list type out there that will do anything other than store two string values.
Ultimately, it would be great if all I had to do to access the list was use a syntax like:
textures["cooltexture"]
Any help would be greatly appreciated. Do I need to look in to createing my own list class?
Adam TurnerPosted Jun 30, 2007, 10:57 PM
Thanks for the help, it got me moving in the right direction.
AlanPosted Jun 30, 2007, 4:46 PM
Moreover, the Item property of this class provides the functionality you're looking for as it is represented by an indexer in C#:
http://msdn2.microsoft.com/en-us/library/9tee9ht2.aspx
For example code like this should work fine:
Dictionary
textures.Add("cooltexture", t2dObject);
Texture2D coolT2d = textures["cooltexture"];