00001 #include <assert.h>
00002 #include "IGS_Group.h"
00003
00004
00005
00006
00007
00008
00009 void IGS_Group::AddObject( IGS_Object* object )
00010 {
00011 assert( object != NULL );
00012 this->objects.push_back( object );
00013 }
00014
00015 IGS_Group::~IGS_Group()
00016 {
00017 int i;
00018 for( i = 0; i < this->objects.size(); i++ )
00019 {
00020 IGS_Object*& object = objects[ i ];
00021 delete object;
00022 object = NULL;
00023 }
00024 }
00025
00026
00027
00028
00029
00030
00031 void IGS_Group::Prepare( const IGS_Controller& controller )
00032 {
00033 int i;
00034 int size = this->objects.size();
00035 for( i = 0; i < size; i++ )
00036 {
00037 IGS_Object* object = this->objects[ i ];
00038 object->Prepare( controller );
00039 }
00040 }
00041
00042
00043
00044
00045
00046
00047 void IGS_Group::Render( const IGS_Controller& controller ) const
00048 {
00049 int i;
00050 int size = this->objects.size();
00051 for( i = 0; i < size; i++ )
00052 {
00053 IGS_Object* object = this->objects[ i ];
00054 object->Render( controller );
00055 }
00056 }