Why a map?
In AddResource you add the loaded resource plus integer equal to one, but you never use this integer? Or i miss something?

Maybe you can use list instead for example?