Original Post
Hi y'' all,
been a while since I visited this board, and I''ve got a question concerning my new game mainframe.
I am working on this mainframe with Object Orientation in my mind. So, therefore most classes inherit the functions etc of other objects. Now one of my classes is called Object. Which inherits from C_Obj, which in general represents a 3d point in space. This way I will know where the object is located at in space.
Now comes the more difficult part. The Object itself contains a pointer to an array of objects. These objects are the polygons, the class Object also has a pointer to an array of C_Obj''s (3d points). In case of the real object it will represent the box it is in. In case of the polygons this will represent the position of the polygon inside the real object.
I was just wondering if you guys would think this a good way of programming the objects in the game.
In general it''ll look like
class Object : public C_Obj
{
public
Object() : C_Obj() {}
Object *Polygons;
Object *Prev_Object;
Object *Next_Object;
C_Obj *Coor_Obj;
};
/////////////////
Object test;
test.Polygons = new Object[6]; // let''s say a box, 6 polygons
test.Polygons->Coor_Obj = new C_Obj[4];
test.Polygons->Coor_Obj[0] = ....
etc etc etc
(note, this is not my original code, but in some case looks like it).
Would it be a good idea or not>