Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
87 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

  Contents

 Introduction
 Object Instances
 Conclusion

 Printable version

 


  The Series

 Part I

 

In Conclusion: The Good And The Bad

As you can see, multiple instances of a module are possible despite what some will have you believe. Using this method, an array of a structure entitled _private takes the place of the private keyword, and in this case it actually is private, not sitting in the interface file for everyone to see like in the case of a class definition. The datatype M_Example is really just an int as an ID to be used as an index to the _private array. When you create an object using Example_CreateInstance, you're just reserving a spot in that array. You'll immediately notice two flaws to this approach I'm sure. First, the number of objects is limited to _MAXOBJECTS. Also, you can create an object, but you apparently can't destroy it. Well, that's where a linked list would come in handy. I only used an array to keep the idea clear, but if you were to use this method, using a linked list is the only way to go. Well, that's it for this article. Any questions, comments, flames, or new article ideas can be directed to godofarson@aol.com. Hopefully this article has sparked some ideas for you, if so let me know.