CEL

Public API Reference

propclass/zone.h

00001 /*
00002     Crystal Space Entity Layer
00003     Copyright (C) 2004 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_PF_ZONE__
00021 #define __CEL_PF_ZONE__
00022 
00023 #include "cstypes.h"
00024 #include "csgeom/vector3.h"
00025 #include "csutil/scf.h"
00026 
00027 struct iSector;
00028 struct iRegion;
00029 struct iPcCamera;
00030 struct iPcMesh;
00031 struct iCelEntity;
00032 struct iStringArray;
00033 struct iString;
00034 struct iDocumentNode;
00035 
00039 struct iCelMapFile : public virtual iBase
00040 {
00041   SCF_INTERFACE (iCelMapFile, 0, 2, 0);
00042 
00046   virtual void SetName (const char* name) = 0;
00047 
00053   virtual void SetPath (const char* path) = 0;
00054 
00059   virtual void SetFile (const char* file) = 0;
00060 
00065   virtual const char* GetName () const = 0;
00066 
00071   virtual const char* GetPath () const = 0;
00072 
00077   virtual const char* GetFile () const = 0;
00078 
00085   virtual void SetSectorName (const char* name) = 0;
00086 
00091   virtual const char* GetSectorName () const = 0;
00092 };
00093 
00098 struct iCelRegion : public virtual iBase
00099 {
00100   SCF_INTERFACE (iCelRegion, 0, 3, 0);
00101 
00103   virtual const char* GetName () const = 0;
00104 
00111   virtual const char* GetCsRegionName () const = 0;
00112 
00120   virtual void SetCachePath (const char* path) = 0;
00121 
00126   virtual const char* GetCachePath () const = 0;
00127 
00132   virtual iCelMapFile* CreateMapFile () = 0;
00133 
00137   virtual size_t GetMapFileCount () const = 0;
00138 
00142   virtual iCelMapFile* GetMapFile (int idx) const = 0;
00143 
00147   virtual iCelMapFile* FindMapFile (const char* name) const = 0;
00148 
00153   virtual bool RemoveMapFile (iCelMapFile* mapfile) = 0;
00154 
00158   virtual void RemoveAllMapFiles () = 0;
00159 
00164   virtual void AssociateEntity (iCelEntity* entity) = 0;
00165 
00169   virtual void DissociateEntity (iCelEntity* entity) = 0;
00170 
00174   virtual bool ContainsEntity (iCelEntity* entity) = 0;
00175 
00179   virtual iRegion* GetCsRegion () = 0;
00180 };
00181 
00186 struct iCelZone : public virtual iBase
00187 {
00188   SCF_INTERFACE (iCelZone, 0, 1, 0);
00189 
00191   virtual const char* GetName () const = 0;
00192 
00196   virtual void LinkRegion (iCelRegion* region) = 0;
00197 
00201   virtual size_t GetRegionCount () const = 0;
00202 
00206   virtual iCelRegion* GetRegion (size_t idx) const = 0;
00207 
00211   virtual iCelRegion* FindRegion (const char* name) const = 0;
00212 
00217   virtual bool UnlinkRegion (iCelRegion* region) = 0;
00218 
00222   virtual void UnlinkAllRegions () = 0;
00223 };
00224 
00228 
00229 #define CEL_ZONEERROR_OK 0
00230 
00232 #define CEL_ZONEERROR_BADREGION 1
00233 
00235 #define CEL_ZONEERROR_BADSTART 2
00236 
00238 #define CEL_ZONEERROR_LOAD 3
00239 
00244 
00245 #define CEL_ZONE_NORMAL 0
00246 
00248 #define CEL_ZONE_KEEP 1
00249 
00251 #define CEL_ZONE_LOADALL 2
00252 
00301 struct iPcZoneManager : public virtual iBase
00302 {
00303   SCF_INTERFACE (iPcZoneManager, 0, 1, 3);
00304 
00310   virtual void EnableColliderWrappers (bool en) = 0;
00311 
00315   virtual bool IsColliderWrappers () const = 0;
00316 
00325   virtual void SetLoadingMode (int mode) = 0;
00326 
00330   virtual int GetLoadingMode () const = 0;
00331 
00338   virtual bool Load (iDocumentNode* node) = 0;
00339 
00352   virtual bool Load (const char* path, const char* file) = 0;
00353 
00357   virtual iCelZone* CreateZone (const char* name) = 0;
00358 
00362   virtual size_t GetZoneCount () const = 0;
00363 
00367   virtual iCelZone* GetZone (int idx) const = 0;
00368 
00372   virtual iCelZone* FindZone (const char* name) const = 0;
00373 
00378   virtual bool RemoveZone (iCelZone* zone) = 0;
00379 
00383   virtual void RemoveAllZones () = 0;
00384 
00388   virtual iCelRegion* CreateRegion (const char* name) = 0;
00389 
00393   virtual size_t GetRegionCount () const = 0;
00394 
00398   virtual iCelRegion* GetRegion (int idx) const = 0;
00399 
00403   virtual iCelRegion* FindRegion (const char* name) const = 0;
00404 
00409   virtual bool RemoveRegion (iCelRegion* region) = 0;
00410 
00414   virtual void RemoveAllRegions () = 0;
00415 
00419   virtual void FindStartLocations (iStringArray* regionnames,
00420         iStringArray* startnames) = 0;
00421 
00427   virtual void GetLastStartLocation (iString* regionname,
00428         iString* startname) = 0;
00434   virtual const char *GetLastStartRegionName () = 0;
00435 
00440   virtual const char *GetLastStartName () = 0;
00441 
00458   virtual int PointCamera (const char* entity, const char* regionname,
00459         const char* startname = 0) = 0;
00460 
00477   virtual int PointMesh (const char* entity, const char* regionname,
00478         const char* startname = 0) = 0;
00479 
00486   virtual bool ActivateRegion (iCelRegion* region,
00487       bool allow_entity_addon = true) = 0;
00488 
00492   virtual iCelRegion* FindRegionContaining (iCelEntity* ent) = 0;
00493 };
00494 
00495 #endif // __CEL_PF_ZONE__
00496 

Generated for CEL: Crystal Entity Layer 1.2 by doxygen 1.4.7