CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Sep 2011
    Posts
    25

    Question Object Managment

    I do have some code for this but i forgot to grab it so ill have to add it later. I'm working on a game engine... funny its my first real project im doing other than a few other small ones, but i learn better with experience so i might as well learn a little bit of everything. Anyways im trying to make a object managment system and im stuck on how im gonna hold the objects and their information. Each object will have its own individual ID 1,2,3,4,5,6,,7,8,9,10,etc. But then (most) or probably all have to hold more information such as color and weight for some of them. But the only thing I can think of is a normal array as im pretty sure that none of the stl arrays can hold more than one matching piece. One alternative could be that whenever an object is created the creator would have to give it a name and that would be the name of the array. Or should each object just be made as a class and then just have another declaration of the class made when you want to have it exist. Also I have a couple more questions...

    - What is the difference between these two methods and when and where should i use them if there is one:

    Code:
    class ObjectManager
    {
     public:
         int Start();
     private:
         
    };
    
    ObjectManager::Start()
    {
    char ObjectManagerStatus;
    }
    Code:
    class ObjectManager
    {
     public:
         int Start();
     private:
         
    };
    ObjectManager ObjMan;
    
    ObjMan.Start()
    {
    char ObjectManagerStatus;
    }
    Also do I have too put what the function Start() does in a .cpp file or can I just put it all in a header file. Every Obect will also have its own individual Id for when there is a clone of itself.
    Last edited by HavingPhun; February 24th, 2012 at 08:19 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured