2
Answers

Custom lists, or something else?

Ask a question
Adam Turner

Adam Turner

17y
2.2k
1

I'm looking for the equivalent of an associative array that will allow me to store strings with textures. I'm new to C# so I can't seem to find a datum that will allow me to accomplish this.

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?


Answers (2)