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 iPcInventory; 00029 00033 struct iPcInventoryListener : public virtual iBase 00034 { 00035 SCF_INTERFACE (iPcInventoryListener, 0, 0, 1); 00036 00040 virtual void AddChild (iPcInventory* inventory, iCelEntity* entity) = 0; 00041 00045 virtual void RemoveChild (iPcInventory* inventory, iCelEntity* entity) = 0; 00046 }; 00047 00048 00053 struct iCelInventorySpaceSlot : public virtual iBase 00054 { 00055 SCF_INTERFACE (iCelInventorySpaceSlot, 0, 0, 1); 00056 00064 virtual iCelEntity* GetEntity (iCelParameterBlock* params) = 0; 00065 00071 virtual bool AddEntity (iCelEntity* entity, iCelParameterBlock* params) = 0; 00072 00077 virtual bool RemoveEntity (iCelEntity* entity) = 0; 00078 00080 virtual int GetCount () = 0; 00081 00083 virtual void RemoveAll () = 0; 00084 00086 virtual bool IsEmpty () = 0; 00087 }; 00088 00094 struct iCelInventorySpace : public virtual iBase 00095 { 00096 SCF_INTERFACE (iCelInventorySpace, 0, 0, 1); 00097 00099 virtual int GetSpaceTotal () const = 0; 00100 00102 virtual int GetSpaceLeft () const = 0; 00103 00104 // Return how much space is taken. 00105 virtual int GetSpaceTaken () const = 0; 00106 00113 virtual bool AddEntity (iCelEntity* entity) = 0; 00118 virtual bool RemoveEntity (iCelEntity* entity) = 0; 00119 00126 virtual bool AddEntity (iCelEntity* entity, iCelParameterBlock* params) = 0; 00132 virtual bool RemoveEntity (iCelParameterBlock* params) = 0; 00133 00134 //. Get rid of all entities inside space. 00135 virtual void RemoveAll () = 0; 00136 00141 virtual iCelInventorySpaceSlot* GetSlot (iCelParameterBlock* params) = 0; 00142 00147 virtual iCelEntity* GetEntity (iCelParameterBlock* params) = 0; 00148 }; 00149 00150 00161 struct iPcInventory : public virtual iBase 00162 { 00163 SCF_INTERFACE (iPcInventory, 1, 0, 0); 00164 00169 virtual void AddInventoryListener (iPcInventoryListener* listener) = 0; 00173 virtual void RemoveInventoryListener (iPcInventoryListener* listener) = 0; 00174 00181 virtual bool AddEntity (iCelEntity* entity) = 0; 00182 00190 virtual bool AddEntity (iCelEntity* entity, iCelParameterBlock* params) = 0; 00191 00196 virtual bool RemoveEntity (iCelEntity* entity) = 0; 00204 virtual bool RemoveEntity (iCelParameterBlock* params) = 0; 00205 00213 virtual bool RemoveAll () = 0; 00214 00218 virtual size_t GetEntityCount () const = 0; 00219 00223 virtual iCelEntity* GetEntity (size_t idx) const = 0; 00224 00228 virtual bool In (iCelEntity* entity) const = 0; 00229 00233 virtual bool In (const char* name) const = 0; 00234 00239 virtual size_t FindEntity (iCelEntity* entity) const = 0; 00240 00245 virtual size_t FindEntity (const char* name) const = 0; 00246 00252 virtual size_t FindEntity (csStringID classid) const = 0; 00253 00257 virtual iCelEntity* GetEntitySlot (iCelParameterBlock* params) const = 0; 00258 00269 virtual bool SetStrictCharacteristics (const char* charName, bool strict) = 0; 00270 00274 virtual bool HasStrictCharacteristics (const char* charName) const = 0; 00275 00284 virtual bool SetConstraints (const char* charName, 00285 float minValue, float maxValue, float totalMaxValue) = 0; 00286 00291 virtual bool GetConstraints (const char* charName, 00292 float& minValue, float& maxValue, float& totalMaxValue) const = 0; 00293 00297 virtual void RemoveConstraints (const char* charName) = 0; 00298 00302 virtual void RemoveAllConstraints () = 0; 00303 00307 virtual float GetCurrentCharacteristic (const char* charName) const = 0; 00308 00315 virtual void MarkDirty (const char* charName) = 0; 00316 00322 virtual bool TestConstraints (const char* charName) = 0; 00323 00328 virtual void Dump () = 0; 00329 00334 virtual void SetSpace (iCelInventorySpace* space) = 0; 00335 00342 virtual iCelInventorySpace* GetSpace () = 0; 00343 }; 00344 00345 #endif // __CEL_PF_INV__ 00346
Generated for CEL: Crystal Entity Layer 2.0 by doxygen 1.6.1
