propclass/inv.h
00001 /* 00002 Crystal Space Entity Layer 00003 Copyright (C) 2001 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_INV__ 00021 #define __CEL_PF_INV__ 00022 00023 #include "cstypes.h" 00024 #include "csutil/scf.h" 00025 #include "behaviourlayer/behave.h" 00026 00027 struct iCelEntity; 00028 struct iCelEntityTemplate; 00029 struct iPcInventory; 00030 struct iLootGenerator; 00031 00035 struct iPcInventoryListener : public virtual iBase 00036 { 00037 SCF_INTERFACE (iPcInventoryListener, 0, 1, 1); 00038 00042 virtual void AddChild (iPcInventory* inventory, iCelEntity* entity) = 0; 00043 00047 virtual void RemoveChild (iPcInventory* inventory, iCelEntity* entity) = 0; 00048 00052 virtual void AddChildTemplate (iPcInventory* inventory, 00053 iCelEntityTemplate* tpl, int amount) = 0; 00054 00058 virtual void RemoveChildTemplate (iPcInventory* inventory, 00059 iCelEntityTemplate* tpl, int amount) = 0; 00060 }; 00061 00062 00067 struct iCelInventorySpaceSlot : public virtual iBase 00068 { 00069 SCF_INTERFACE (iCelInventorySpaceSlot, 0, 0, 1); 00070 00078 virtual iCelEntity* GetEntity (iCelParameterBlock* params) = 0; 00079 00085 virtual bool AddEntity (iCelEntity* entity, iCelParameterBlock* params) = 0; 00086 00091 virtual bool RemoveEntity (iCelEntity* entity) = 0; 00092 00094 virtual int GetCount () = 0; 00095 00097 virtual void RemoveAll () = 0; 00098 00100 virtual bool IsEmpty () = 0; 00101 }; 00102 00108 struct iCelInventorySpace : public virtual iBase 00109 { 00110 SCF_INTERFACE (iCelInventorySpace, 0, 1, 1); 00111 00113 virtual int GetSpaceTotal () const = 0; 00114 00116 virtual int GetSpaceLeft () const = 0; 00117 00118 // Return how much space is taken. 00119 virtual int GetSpaceTaken () const = 0; 00120 00129 virtual bool AddEntity (iCelEntity* entity, iCelParameterBlock* params = 0) = 0; 00134 virtual bool RemoveEntity (iCelEntity* entity) = 0; 00135 00141 virtual bool RemoveEntity (iCelParameterBlock* params) = 0; 00142 00143 //. Get rid of all entities inside space. 00144 virtual void RemoveAll () = 0; 00145 00150 virtual iCelInventorySpaceSlot* GetSlot (iCelParameterBlock* params) = 0; 00151 00156 virtual iCelEntity* GetEntity (iCelParameterBlock* params) = 0; 00157 }; 00158 00159 00179 struct iPcInventory : public virtual iBase 00180 { 00181 SCF_INTERFACE (iPcInventory, 1, 1, 0); 00182 00187 virtual void AddInventoryListener (iPcInventoryListener* listener) = 0; 00191 virtual void RemoveInventoryListener (iPcInventoryListener* listener) = 0; 00192 00201 virtual bool AddEntity (iCelEntity* entity, iCelParameterBlock* params = 0) = 0; 00202 00207 virtual bool RemoveEntity (iCelEntity* entity) = 0; 00215 virtual bool RemoveEntity (iCelParameterBlock* params) = 0; 00216 00224 virtual bool AddEntityTemplate (iCelEntityTemplate* tpl, int amount) = 0; 00225 00233 virtual bool RemoveEntityTemplate (iCelEntityTemplate* tpl, int amount) = 0; 00234 00242 virtual bool RemoveAll () = 0; 00243 00244 //-------------------------------------------------------------------- 00245 00249 virtual size_t GetEntityCount () const = 0; 00250 00254 virtual iCelEntity* GetEntity (size_t idx) const = 0; 00255 00259 virtual bool In (iCelEntity* entity) const = 0; 00260 00264 virtual bool In (const char* name) const = 0; 00265 00270 virtual size_t FindEntity (iCelEntity* entity) const = 0; 00271 00276 virtual size_t FindEntity (const char* name) const = 0; 00277 00283 virtual size_t FindEntity (csStringID classid) const = 0; 00284 00285 //-------------------------------------------------------------------- 00286 00292 virtual size_t GetEntityTemplateCount () const = 0; 00293 00297 virtual iCelEntityTemplate* GetEntityTemplate (size_t idx) const = 0; 00298 00302 virtual int GetEntityTemplateAmount (size_t idx) const = 0; 00303 00307 virtual bool In (iCelEntityTemplate* tpl) const = 0; 00308 00313 virtual size_t FindEntityTemplate (iCelEntityTemplate* tpl) const = 0; 00314 00319 virtual size_t FindEntityTemplate (const char* name) const = 0; 00320 00326 virtual size_t FindEntityTemplate (csStringID classid) const = 0; 00327 00328 //-------------------------------------------------------------------- 00329 00333 virtual iCelEntity* GetEntitySlot (iCelParameterBlock* params) const = 0; 00334 00345 virtual bool SetStrictCharacteristics (const char* charName, bool strict) = 0; 00346 00350 virtual bool HasStrictCharacteristics (const char* charName) const = 0; 00351 00360 virtual bool SetConstraints (const char* charName, 00361 float minValue, float maxValue, float totalMaxValue) = 0; 00362 00367 virtual bool GetConstraints (const char* charName, 00368 float& minValue, float& maxValue, float& totalMaxValue) const = 0; 00369 00373 virtual void RemoveConstraints (const char* charName) = 0; 00374 00378 virtual void RemoveAllConstraints () = 0; 00379 00383 virtual float GetCurrentCharacteristic (const char* charName) const = 0; 00384 00391 virtual void MarkDirty (const char* charName) = 0; 00392 00398 virtual bool TestConstraints (const char* charName) = 0; 00399 00404 virtual void Dump () = 0; 00405 00410 virtual void SetSpace (iCelInventorySpace* space) = 0; 00411 00418 virtual iCelInventorySpace* GetSpace () = 0; 00419 00424 virtual void AddAllowedClass (csStringID cls) = 0; 00425 00430 virtual void ClearAllowedClasses () = 0; 00431 00436 virtual bool IsClassAllowed (csStringID cls) const = 0; 00437 00445 virtual void SetLootGenerator (iLootGenerator* generator) = 0; 00446 00450 virtual iLootGenerator* GetLootGenerator () const = 0; 00451 00457 virtual bool GenerateLoot () = 0; 00458 }; 00459 00460 #endif // __CEL_PF_INV__ 00461
Generated for CEL: Crystal Entity Layer 2.1 by doxygen 1.6.1
