|
-
April 20th, 2009, 05:59 PM
#14
Re: Structure Question.
 Originally Posted by Lindley
It sounds to me like you want a std::map< std::string, Weapon >. That's the closest you can get to what you seem to be trying to do.
Alternatively, you could look into inheritance, for instance defining ShortSword as a subclass of Weapon. That wouldn't be worthwhile unless you had a number of different ShortSword objects you expected to be manipulating with various properties.
From your questions, I'm wondering whether you really understand what object scope is all about.
No Im not sure, I've just started to learn C++ and its not in the book I have (Game Institute, Game Programming 1).
But could you give me a link to an explanation / example?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|