CEL

Public API Reference

Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

pl.h

00001 /*
00002     Crystal Space Entity Layer
00003     Copyright (C) 2001-2005 by Jorrit Tyberghein
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef __CEL_PL_PL__
00021 #define __CEL_PL_PL__
00022 
00023 #include "cstypes.h"
00024 #include "csutil/scf.h"
00025 #include "csutil/strset.h"
00026 #include "csutil/ref.h"
00027 
00028 struct iObject;
00029 struct iCelEntity;
00030 struct iCelEntityList;
00031 struct iCelDataBuffer;
00032 struct iCelMessage;
00033 struct iCelPropertyClass;
00034 struct iCelPropertyClassFactory;
00035 struct iCelBlLayer;
00036 struct iCelBehaviour;
00037 struct iCelEntityTemplate;
00038 struct iSector;
00039 struct iCamera;
00040 class csVector3;
00041 class csBox3;
00042 class csString;
00043 
00045 typedef csHash<csStrKey, csStrKey> celEntityTemplateParams;
00046 
00047 struct iCelEntityTracker;
00048 
00053 struct iCelNewEntityCallback : public virtual iBase
00054 {
00055   SCF_INTERFACE (iCelNewEntityCallback, 0, 0, 2);
00056 
00058   virtual void NewEntity (iCelEntity* entity) = 0;
00059 };
00060 
00065 struct iCelEntityRemoveCallback : public virtual iBase
00066 {
00067   SCF_INTERFACE (iCelEntityRemoveCallback, 0, 0, 2);
00068 
00070   virtual void RemoveEntity (iCelEntity* entity) = 0;
00071 };
00072 
00073 
00078 struct iCelTimerListener : public virtual iBase
00079 {
00080   SCF_INTERFACE (iCelTimerListener, 0, 0, 1);
00081 
00086   virtual void TickEveryFrame () = 0;
00087 
00092   virtual void TickOnce () = 0;
00093 };
00094 
00095 SCF_VERSION (iCelPlLayer, 0, 3, 2);
00096 
00100 struct iCelPlLayer : public iBase
00101 {
00107   virtual csPtr<iCelEntity> CreateEntity () = 0;
00108 
00113   virtual csPtr<iCelEntity> CreateEntityInScope (int scope) = 0;
00114 
00120   virtual csPtr<iCelEntity> CreateEntity (uint id) = 0;
00121 
00137   virtual csPtr<iCelEntity> CreateEntity (const char* entname,
00138         iCelBlLayer* bl, const char* bhname, ...) = 0;
00139 
00143   virtual void RemoveEntity (iCelEntity* entity) = 0;
00144 
00148   virtual void RemoveEntities () = 0;
00149 
00154   virtual iCelEntityTemplate* CreateEntityTemplate (const char* factname) = 0;
00155 
00159   virtual void RemoveEntityTemplate (iCelEntityTemplate* entfact) = 0;
00160 
00164   virtual void RemoveEntityTemplates () = 0;
00165 
00169   virtual iCelEntityTemplate* FindEntityTemplate (const char* factname) = 0;
00170 
00178   virtual iCelEntity* CreateEntity (iCelEntityTemplate* factory,
00179         const char* name, const celEntityTemplateParams& params) = 0;
00180 
00184   virtual csPtr<iCelMessage> CreateMessage (const char* msg_string, ...) = 0;
00185 
00192   virtual csPtr<iCelDataBuffer> CreateDataBuffer (long serialnr) = 0;
00193 
00199   virtual void AttachEntity (iObject* object, iCelEntity* entity) = 0;
00200 
00204   virtual void UnattachEntity (iObject* object, iCelEntity* entity) = 0;
00205 
00209   virtual iCelEntity* GetEntity (uint id) = 0;
00210 
00214   virtual size_t GetEntityCount () const = 0;
00215 
00219   virtual iCelEntity* GetEntityByIndex (size_t idx) const = 0;
00220 
00226   virtual iCelEntity* FindEntity (const char* name) = 0;
00227 
00232   virtual iCelBehaviour* GetBehaviour (uint id) = 0;
00233 
00237   virtual iCelEntity* FindAttachedEntity (iObject* object) = 0;
00238 
00243   virtual csPtr<iCelEntityList> FindNearbyEntities (iSector* sector,
00244         const csVector3& pos, float radius) = 0;
00245 
00250   virtual csPtr<iCelEntityList> FindNearbyEntities (iSector* sector,
00251         const csBox3& box) = 0;
00252 
00258   virtual iCelEntity* GetHitEntity (iCamera* camera, int x, int y) = 0;
00259 
00263   virtual csPtr<iCelEntityList> CreateEmptyEntityList () = 0;
00264 
00269   virtual iCelEntityTracker* CreateEntityTracker (const char* name) = 0;
00270 
00274   virtual iCelEntityTracker* FindEntityTracker (const char* name) = 0;
00275 
00279   virtual void RemoveEntityTracker (iCelEntityTracker* tracker) = 0;
00280 
00288   virtual void SetEntityAddonAllowed (bool allow) = 0;
00289 
00293   virtual bool IsEntityAddonAllowed () const = 0;
00294 
00295   //-------------------------------------------------------------------------
00296 
00302   virtual bool LoadPropertyClassFactory (const char* plugin_id) = 0;
00303 
00310   virtual void RegisterPropertyClassFactory (iCelPropertyClassFactory* pf) = 0;
00311 
00315   virtual void UnregisterPropertyClassFactory (
00316         iCelPropertyClassFactory* pf) = 0;
00317 
00321   virtual size_t GetPropertyClassFactoryCount () const = 0;
00322 
00326   virtual iCelPropertyClassFactory* GetPropertyClassFactory (size_t idx)
00327         const = 0;
00328 
00332   virtual iCelPropertyClassFactory* FindPropertyClassFactory (
00333         const char* name) const = 0;
00334 
00340   virtual iCelPropertyClass* CreatePropertyClass
00341       (iCelEntity* entity, const char* propname) = 0;
00342 
00348   virtual iCelPropertyClass* CreateTaggedPropertyClass
00349       (iCelEntity* entity, const char* propname, const char* tagname) = 0;
00350 
00351   //-------------------------------------------------------------------------
00352 
00356   virtual void RegisterBehaviourLayer (iCelBlLayer* bl) = 0;
00357 
00361   virtual void UnregisterBehaviourLayer (iCelBlLayer* bl) = 0;
00362 
00366   virtual size_t GetBehaviourLayerCount () const = 0;
00367 
00371   virtual iCelBlLayer* GetBehaviourLayer (size_t idx) const = 0;
00372 
00376   virtual iCelBlLayer* FindBehaviourLayer (const char* name) const = 0;
00377 
00378   //-------------------------------------------------------------------------
00379 
00385   virtual void Cache (iBase* object) = 0;
00386 
00390   virtual void Uncache (iBase* object) = 0;
00391 
00397   virtual void CleanCache () = 0;
00398 
00399   //-------------------------------------------------------------------------
00400 
00411   virtual csStringID FetchStringID (const char* str) = 0;
00412 
00417   virtual const char* FetchString (csStringID id) = 0;
00418 
00423   virtual void AddEntityRemoveCallback (iCelEntityRemoveCallback* clback) = 0;
00424 
00428   virtual void RemoveEntityRemoveCallback (
00429         iCelEntityRemoveCallback* clback) = 0;
00430 
00435   virtual void AddNewEntityCallback (iCelNewEntityCallback* clback) = 0;
00436 
00440   virtual void RemoveNewEntityCallback (iCelNewEntityCallback* clback) = 0;
00441 
00442   //-------------------------------------------------------------------------
00443 
00451   virtual void CallbackEveryFrame (iCelTimerListener* listener, int where) = 0;
00452 
00461   virtual void CallbackOnce (iCelTimerListener* listener, csTicks delta,
00462         int where) = 0;
00463 
00467   virtual void RemoveCallbackEveryFrame (iCelTimerListener* listener,
00468         int where) = 0;
00469 
00473   virtual void RemoveCallbackOnce (iCelTimerListener* listener, int where) = 0;
00474 
00481   virtual int AddScope (csString version, int size) = 0;
00482 };
00483 
00484 SCF_VERSION (iCelEntityTracker, 0, 0, 1);
00485 
00491 struct iCelEntityTracker : public iBase
00492 {
00496   virtual const char* GetName () const = 0;
00497 
00503   virtual bool AddEntity (iCelEntity* entity) = 0;
00504 
00508   virtual void RemoveEntity (iCelEntity* entity) = 0;
00509 
00513   virtual void RemoveEntities () = 0;
00514 
00519   virtual csPtr<iCelEntityList> FindNearbyEntities (iSector* sector,
00520         const csVector3& pos, float radius) = 0;
00521 };
00522 
00523 #endif // __CEL_PL_PL__
00524 

Generated for CEL: Crystal Entity Layer by doxygen 1.4.4