Enumerations of Sprites

So, I’ve worked myself in so many circles that I’ve totally gotten myself turned around and confused.

Here’s what I’m trying to do:

I have a paper 2D game, with many materials. These materials are in an enumeration (itemEnum). When a material shows up…

  • a background sprite should get created
  • on creation, a itemEnum is set, defining what kind of material this is
  • a top sprite component should be added (i can do this part), with the sprite coming from an array based on the value of the instance’s itemEnum

So basically, how do I create a library of sprites and reference that at creation time to put the right sprite on the actor?

I can do it in a giant switch, but I figure there has to be a more efficient way.

~D