1. Developing an item class that could handle any item.
In a sense this doesn't need to be overly difficult if you just create vectors for each different item. i.e shield vector, weapon vector etc. However I wanted to find a more satisfactory solution and decided to explore some of the methods suggested such as the pimpl(private implementation/handle classe). I was hoping this would then allow me to just create a vector of items that could then be a weapon, shield of just a standard item. I have read that the pimpl is a common idiom used within c++ however I have never used it before and have found it to be quite difficult to grasp - for me it feels like it would only work if all the classes and derived classes had exactly the same interface which I don't think is always possible.
2. Developing the room/map engine.
Not sure about this - if you are reading from a text file how would the text file be organised?
Also if the player came into a room from the east side rather than the north side does the description change?
Quote:
Original post by Darkstrike
This links to my question I asked before: how long should such a mini-project take a practicing programmer? Less than a day? A day? A couple of days? More than half of my time was used for debugging; is that normal? I ended up rewriting my code a lot, it has barely anything left in it from Project 1; is that normal, considering that we should develop code-reusage skills and design in a way that would allow us to minimize the amount of extra work to be done?
I would also like to know this - project 1 took me about 12 - 14 hours to complete and quite a lot of time was spent testing the game and then fixing some of the code, I knew this project would take a lot longer.
With code reuse, I always get the impression that when learning c++, code reuse is always something that gets mentioned alot leaving you thinking that when you develop classes they are somehow perfect and can be reused constantly - I don't think this is the case, however I would like to see someone who is extremely proficient at c++ develop project 1 and 2 to see how they have broken the project down.