The above image shows the current state of the item manager class.
I haven't written much code this last week, mostly due to life.
But I have a feeling that I might have some free time this weekend. I have been thinking a bit about the new UI manager and how it will affect items within the game. As the Item manager is a bit dated I feel that I will just delete it and write a new one. While is probably trivial to code, its the inter workings that need more thought. I could just have a static array of items referenced by Id, but then I am limited to a hard coded number of items. I could have a linked list of items and just add to it on the fly, which is probably the route I am going to take.
While I am definitely planning the implementation of randomly generated items, they will be easy to add later. But still questions and choices persist:
- Should I hard code some items like health potions? Or hard code all items? Or load some from file, or load all from file?
- Should I allow for unlimited item effects or sockets? Or hard code a maximum value?
- Should I allow for items to be modifiable during play, such as adding sockets, and / or effects?
- Should socket items be socketable? :O (Segfault waiting to happen!) Imagine placing a gem in to a gold nugget's socket,and then placing that in to a shield's socket...etc... (O_o)
- How would it be best for the UI manager and item manager to interact?
- How should I manage item effects? (O_o) Have a separate effects manager that works the same as the item manager? Or integrate them? Its not the complexity of the code that bothers me its the efficiency and extensibility of the code.
While there are definitely more questions on this topic, these are the current ones floating about in my head. Might have to whip out some paper and crack open my pencil case this weekend. I really should get myself a whiteboard!