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 iObject *QueryObject()
00078 { return scfParent; }
00079 virtual iObject* FindObject (char* name) const
00080 { return scfParent->FindObject(name); }
00081 virtual int GetObjectCount () const
00082 { return scfParent->GetObjectCount(); }
00083 virtual void AddObject (iObject* obj)
00084 { scfParent->AddObject(obj); }
00085 virtual iObject* operator[] (int i) const
00086 { return (*scfParent)[i]; }
00087 virtual iObject* GetObject (int i) const
00088 { return (*scfParent)[i]; }
00089 } scfiCollection;
00090 friend struct Collection;
00091 };
00092
00093 #endif // __CS_CSCOLL_H__