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 00164 struct iPcInventory : public virtual iBase 00165 { 00166 SCF_INTERFACE (iPcInventory, 0, 0, 1); 00167 00172 virtual void AddInventoryListener (iPcInventoryListener* listener) = 0; 00176 virtual void RemoveInventoryListener (iPcInventoryListener* listener) = 0; 00177 00184 virtual bool AddEntity (iCelEntity* entity) = 0; 00185 00193 virtual bool AddEntity (iCelEntity* entity, iCelParameterBlock* params) = 0; 00194 00199 virtual bool RemoveEntity (iCelEntity* entity) = 0; 00207 virtual bool RemoveEntity (iCelParameterBlock* params) = 0; 00208 00216 virtual bool RemoveAll () = 0; 00217 00221 virtual size_t GetEntityCount () const = 0; 00222 00226 virtual iCelEntity* GetEntity (size_t idx) const = 0; 00227 00231 virtual iCelEntity* GetEntitySlot (iCelParameterBlock* params) const = 0; 00232 00243 virtual bool SetStrictCharacteristics (const char* charName, bool strict) = 0; 00244 00248 virtual bool HasStrictCharacteristics (const char* charName) const = 0; 00249 00258 virtual bool SetConstraints (const char* charName, 00259 float minValue, float maxValue, float totalMaxValue) = 0; 00260 00265 virtual bool GetConstraints (const char* charName, 00266 float& minValue, float& maxValue, float& totalMaxValue) const = 0; 00267 00271 virtual void RemoveConstraints (const char* charName) = 0; 00272 00276 virtual void RemoveAllConstraints () = 0; 00277 00281 virtual float GetCurrentCharacteristic (const char* charName) const = 0; 00282 00289 virtual void MarkDirty (const char* charName) = 0; 00290 00296 virtual bool TestConstraints (const char* charName) = 0; 00297 00302 virtual void Dump () = 0; 00303 00308 virtual void SetSpace (iCelInventorySpace* space) = 0; 00309 00313 virtual iCelInventorySpace* GetSpace () = 0; 00314 }; 00315 00316 #endif // __CEL_PF_INV__ 00317
Generated for CEL: Crystal Entity Layer by doxygen 1.4.6