## Public API Reference

- Main Page
- Classes
- Files

# 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 bool In (iCelEntity* entity) const = 0;
    00232
    00236   virtual bool In (const char* name) const = 0;
    00237
    00242   virtual size_t FindEntity (iCelEntity* entity) const = 0;
    00243
    00248   virtual size_t FindEntity (const char* name) const = 0;
    00249
    00253   virtual iCelEntity* GetEntitySlot (iCelParameterBlock* params) const = 0;
    00254
    00265   virtual bool SetStrictCharacteristics (const char* charName, bool strict) = 0;
    00266
    00270   virtual bool HasStrictCharacteristics (const char* charName) const = 0;
    00271
    00280   virtual bool SetConstraints (const char* charName,
    00281         float minValue, float maxValue, float totalMaxValue) = 0;
    00282
    00287   virtual bool GetConstraints (const char* charName,
    00288         float& minValue, float& maxValue, float& totalMaxValue) const = 0;
    00289
    00293   virtual void RemoveConstraints (const char* charName) = 0;
    00294
    00298   virtual void RemoveAllConstraints () = 0;
    00299
    00303   virtual float GetCurrentCharacteristic (const char* charName) const = 0;
    00304
    00311   virtual void MarkDirty (const char* charName) = 0;
    00312
    00318   virtual bool TestConstraints (const char* charName) = 0;
    00319
    00324   virtual void Dump () = 0;
    00325
    00330   virtual void SetSpace (iCelInventorySpace* space) = 0;
    00331
    00335   virtual iCelInventorySpace* GetSpace () = 0;
    00336 };
    00337
    00338 #endif // __CEL_PF_INV__
    00339