Hashes / Dictionaries / Lookups

Monkey Forums/Monkey Beginners/Hashes / Dictionaries / Lookups

Kieryn(Posted 2015) [#1]
Hi - I'm pretty new to Monkey...

Just wondering the easiest way to create a string based hash lookup or dictionary like object?

My goal is for creating a simple asset manager. I want to lookup a asset by it's name and if not found then load it dynamically and cache it for next time. If there's any example code for something like this that would be great.

-Kieryn


therevills(Posted 2015) [#2]
I do something similar with Diddy's images and sounds maps which uses the built in StringMap object:

Field images:ImageBank


Class ImageBank Extends StringMap<GameImage>



Kieryn(Posted 2015) [#3]
Perfect! StringMap was what I needed - Thanks. :-)