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 00162 struct iPcInventory : public virtual iBase 00163 { 00164 SCF_INTERFACE (iPcInventory, 0, 0, 1); 00165 00170 virtual void AddInventoryListener (iPcInventoryListener* listener) = 0; 00174 virtual void RemoveInventoryListener (iPcInventoryListener* listener) = 0; 00175 00182 virtual bool AddEntity (iCelEntity* entity) = 0; 00183 00191 virtual bool AddEntity (iCelEntity* entity, iCelParameterBlock* params) = 0; 00192 00197 virtual bool RemoveEntity (iCelEntity* entity) = 0; 00205 virtual bool RemoveEntity (iCelParameterBlock* params) = 0; 00206 00214 virtual bool RemoveAll () = 0; 00215 00219 virtual size_t GetEntityCount () const = 0; 00220 00224 virtual iCelEntity* GetEntity (size_t idx) const = 0; 00225 00229 virtual bool In (iCelEntity* entity) const = 0; 00230 00234 virtual bool In (const char* name) const = 0; 00235 00240 virtual size_t FindEntity (iCelEntity* entity) const = 0; 00241 00246 virtual size_t FindEntity (const char* name) const = 0; 00247 00251 virtual iCelEntity* GetEntitySlot (iCelParameterBlock* params) const = 0; 00252 00263 virtual bool SetStrictCharacteristics (const char* charName, bool strict) = 0; 00264 00268 virtual bool HasStrictCharacteristics (const char* charName) const = 0; 00269 00278 virtual bool SetConstraints (const char* charName, 00279 float minValue, float maxValue, float totalMaxValue) = 0; 00280 00285 virtual bool GetConstraints (const char* charName, 00286 float& minValue, float& maxValue, float& totalMaxValue) const = 0; 00287 00291 virtual void RemoveConstraints (const char* charName) = 0; 00292 00296 virtual void RemoveAllConstraints () = 0; 00297 00301 virtual float GetCurrentCharacteristic (const char* charName) const = 0; 00302 00309 virtual void MarkDirty (const char* charName) = 0; 00310 00316 virtual bool TestConstraints (const char* charName) = 0; 00317 00322 virtual void Dump () = 0; 00323 00328 virtual void SetSpace (iCelInventorySpace* space) = 0; 00329 00333 virtual iCelInventorySpace* GetSpace () = 0; 00334 }; 00335 00336 #endif // __CEL_PF_INV__ 00337
Generated for CEL: Crystal Entity Layer by doxygen 1.4.7