BVB Source Codes

CRYENGINE Show ScriptBind_Inventory.h Source code

Return Download CRYENGINE: download ScriptBind_Inventory.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.    Description: Script Binding for Inventory
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 4:9:2005   15:29 : Created by M谩rcio Martins
  12.  
  13. *************************************************************************/
  14. #ifndef __SCRIPTBIND_INVENTORY_H__
  15. #define __SCRIPTBIND_INVENTORY_H__
  16.  
  17. #if _MSC_VER > 1000
  18.         #pragma once
  19. #endif
  20.  
  21. #include <CryScriptSystem/IScriptSystem.h>
  22. #include <CryScriptSystem/ScriptHelpers.h>
  23.  
  24. struct IItemSystem;
  25. struct IGameFramework;
  26. class CInventory;
  27.  
  28. class CScriptBind_Inventory :
  29.         public CScriptableBase
  30. {
  31. public:
  32.         CScriptBind_Inventory(ISystem* pSystem, IGameFramework* pGameFramework);
  33.         virtual ~CScriptBind_Inventory();
  34.         void         Release() { delete this; };
  35.         void         AttachTo(CInventory* pInventory);
  36.         void         DetachFrom(CInventory* pInventory);
  37.  
  38.         virtual void GetMemoryUsage(ICrySizer* pSizer) const
  39.         {
  40.                 pSizer->AddObject(this, sizeof(*this));
  41.         }
  42.  
  43.         //! <code>Inventory.Destroy()</code>
  44.         //! <description>Destroys the inventory.</description>
  45.         int Destroy(IFunctionHandler* pH);
  46.  
  47.         //! <code>Inventory.Clear()</code>
  48.         //! <description>Clears the inventory.</description>
  49.         int Clear(IFunctionHandler* pH);
  50.  
  51.         //! <code>Inventory.Dump()</code>
  52.         //! <description>Dumps the inventory.</description>
  53.         int Dump(IFunctionHandler* pH);
  54.  
  55.         //! <code>Inventory.GetItemByClass( className )</code>
  56.         //!             <param name="className">Class name.</param>
  57.         //! <description>Gets item by class name.</description>
  58.         int GetItemByClass(IFunctionHandler* pH, const char* className);
  59.  
  60.         //! <code>Inventory.GetGrenadeWeaponByClass( className )</code>
  61.         //!             <param name="className">Class name.</param>
  62.         //! <description>Gets grenade weapon by class name.</description>
  63.         int GetGrenadeWeaponByClass(IFunctionHandler* pH, const char* className);
  64.  
  65.         //! <code>Inventory.HasAccessory( accessoryName )</code>
  66.         //!             <param name="accessoryName">Accessory name.</param>
  67.         //! <description>Checks if the inventory contains the specified accessory.</description>
  68.         int HasAccessory(IFunctionHandler* pH, const char* accessoryName);
  69.  
  70.         //! <code>Inventory.GetCurrentItemId()</code>
  71.         //! <description>Gets the identifier of the current item.</description>
  72.         int GetCurrentItemId(IFunctionHandler* pH);
  73.  
  74.         //! <code>Inventory.GetCurrentItem()</code>
  75.         //! <description>Gets the current item.</description>
  76.         int GetCurrentItem(IFunctionHandler* pH);
  77.  
  78.         //! <code>Inventory.GetAmmoCount(ammoName)</code>
  79.         //!             <param name="ammoName">Ammunition name.</param>
  80.         //! <description>Gets the amount of the specified ammunition name.</description>
  81.         int GetAmmoCount(IFunctionHandler* pH, const char* ammoName);
  82.  
  83.         //! <code>Inventory.GetAmmoCapacity( ammoName )</code>
  84.         //!             <param name="ammoName">Ammunition name.</param>
  85.         //! <description>Gets the capacity for the specified ammunition.</description>
  86.         int GetAmmoCapacity(IFunctionHandler* pH, const char* ammoName);
  87.  
  88.         //! <code>Inventory.SetAmmoCount( ammoName, count )</code>
  89.         //!             <param name="ammoName">Ammunition name.</param>
  90.         //!             <param name="count">Ammunition amount.</param>
  91.         //! <description>Sets the amount of the specified ammunition.</description>
  92.         int SetAmmoCount(IFunctionHandler* pH, const char* ammoName, int count);
  93.  
  94. private:
  95.         void        RegisterGlobals();
  96.         void        RegisterMethods();
  97.  
  98.         CInventory* GetInventory(IFunctionHandler* pH);
  99.  
  100.         ISystem*        m_pSystem;
  101.         IEntitySystem*  m_pEntitySystem;
  102.         IGameFramework* m_pGameFramework;
  103. };
  104.  
  105. #endif //__SCRIPTBIND_INVENTORY_H__
  106.  
downloadScriptBind_Inventory.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top