tools/loot.h
00001 /* 00002 Crystal Space Entity Layer 00003 Copyright (C) 2011 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_LOOT__ 00021 #define __CEL_LOOT__ 00022 00023 struct iParameter; 00024 struct iCelParameterBlock; 00025 struct iPcInventory; 00026 00031 struct iLootGenerator : public virtual iBase 00032 { 00033 SCF_INTERFACE (iLootGenerator, 0, 0, 1); 00034 00038 virtual const char* GetName () const = 0; 00039 00049 virtual bool GenerateLoot (iPcInventory* inventory, iCelParameterBlock* params) = 0; 00050 }; 00051 00056 struct iLootPackage : public virtual iBase 00057 { 00058 SCF_INTERFACE (iLootPackage, 0, 0, 1); 00059 00066 virtual void SetMinLoot (int m) = 0; 00067 virtual int GetMinLoot () const = 0; 00068 virtual void SetMaxLoot (int m) = 0; 00069 virtual int GetMaxLoot () const = 0; 00070 00078 virtual void SetRandomGeneration (bool r) = 0; 00079 virtual bool IsRandomGenerationEnabled () const = 0; 00080 00095 virtual void AddLootItem (const char* templateName, float chance, int minamount, int maxamount, 00096 iParameter* validatePar = 0) = 0; 00097 virtual size_t GetLootItemCount () const = 0; 00098 virtual const char* GetLootItemTemplate (size_t idx) const = 0; 00099 virtual float GetLootItemChance (size_t idx) const = 0; 00100 virtual int GetLootItemMinAmount (size_t idx) const = 0; 00101 virtual int GetLootItemMaxAmount (size_t idx) const = 0; 00102 virtual iParameter* GetLootItemValidate (size_t idx) const = 0; 00103 00107 virtual iLootGenerator* QueryLootGenerator () = 0; 00108 }; 00109 00114 struct iLootSelector : public virtual iBase 00115 { 00116 SCF_INTERFACE (iLootSelector, 0, 0, 1); 00117 00130 virtual void AddLootGenerator (iLootGenerator* generator, float chance, iParameter* validatePar = 0) = 0; 00131 virtual size_t GetLootGeneratorCount () const = 0; 00132 virtual iLootGenerator* GetLootGenerator (size_t idx) const = 0; 00133 virtual float GetLootGeneratorChance (size_t idx) const = 0; 00134 virtual iParameter* GetLootGeneratorValidate (size_t idx) const = 0; 00135 00139 virtual iLootGenerator* QueryLootGenerator () = 0; 00140 }; 00141 00146 struct iLootManager: public virtual iBase 00147 { 00148 SCF_INTERFACE (iLootManager, 0, 0, 1); 00149 00153 virtual iLootPackage* CreateLootPackage (const char* name) = 0; 00154 virtual size_t GetLootPackageCount () const = 0; 00155 virtual iLootPackage* GetLootPackage (size_t idx) const = 0; 00156 virtual iLootPackage* FindLootPackage (const char* name) const = 0; 00157 00163 virtual void RemoveLootPackage (iLootPackage* package) = 0; 00164 00168 virtual iLootSelector* CreateLootSelector (const char* name) = 0; 00169 virtual size_t GetLootSelectorCount () const = 0; 00170 virtual iLootSelector* GetLootSelector (size_t idx) const = 0; 00171 virtual iLootSelector* FindLootSelector (const char* name) const = 0; 00172 00178 virtual void RemoveLootSelector (iLootSelector* selector) = 0; 00179 00185 virtual iLootGenerator* FindLootGenerator (const char* name) const = 0; 00186 }; 00187 00188 #endif // __CEL_LOOT__ 00189
Generated for CEL: Crystal Entity Layer 2.1 by doxygen 1.6.1
