00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CS_CSCOLL_H__
00020 #define __CS_CSCOLL_H__
00021
00022 #include "csgeom/matrix3.h"
00023 #include "csutil/csobject.h"
00024 #include "csutil/csvector.h"
00025 #include "iengine/collectn.h"
00026
00027 class csSector;
00028 class csEngine;
00029
00030 SCF_VERSION (csCollection, 0, 0, 1);
00031
00036 class csCollection : public csObject
00037 {
00038 private:
00040 csVector objects;
00041
00043 csEngine* engine;
00044
00045 private:
00047 virtual ~csCollection ();
00048
00049 public:
00053 csCollection (csEngine* engine);
00054
00058 iObject* FindObject (char* name);
00059
00063 int GetObjectCount () const { return objects.Length(); }
00064
00066 void AddObject (iObject* obj) { objects.Push((csSome)obj); }
00067
00069 iObject* operator[] (int i) { return (iObject*) (objects[i]); }
00070
00071 SCF_DECLARE_IBASE;
00072
00073
00074 struct Collection : public iCollection
00075 {
00076 SCF_DECLARE_EMBEDDED_IBASE (csCollection);
00077 virtual void* GetPrivateObject () { return (void*)scfParent; }
00078 virtual iObject *QueryObject()
00079 { return scfParent; }
00080 virtual iObject* FindObject (char* name) const
00081 { return scfParent->FindObject(name); }
00082 virtual int GetObjectCount () const
00083 { return scfParent->GetObjectCount(); }
00084 virtual void AddObject (iObject* obj)
00085 { scfParent->AddObject(obj); }
00086 virtual iObject* operator[] (int i) const
00087 { return (*scfParent)[i]; }
00088 virtual iObject* GetObject (int i) const
00089 { return (*scfParent)[i]; }
00090 } scfiCollection;
00091 friend struct Collection;
00092 };
00093
00094 #endif // __CS_CSCOLL_H__