I'm pondering about the best way to represent objects that can be picked up in my 2D engine.
I have an Actor class which is the base for all objects that can be spawned into the game. This class offers a location and some other information needed by all actors.
Now, let's take an Apple for example. It's derived from Actor and carries with it all the information needed to be in the game-world. But when I pick this item up and put it inside an inventory, I don't need all that Actor stuff. So I was pondering. Does it make sense to maybe have an AppleActor class instead that derives from Actor, and inside it have an Apple class derived from something like InventoryItem?
When I pick up an Actor, I would take the InventoryItem out of it, store it in my inventory and destroy the Actor. Then, when I drop the InventoryItem, I would first create the corresponding Actor for it, put the InventoryItem inside it and spawn that Actor in the world.
Does this make sense at all? Any feedback or advice from more experienced people here is welcome.