/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ // Original file Copyright Crytek GMBH or its affiliates, used under license. // Description : Script Binding for Inventory #ifndef CRYINCLUDE_CRYACTION_SCRIPTBIND_INVENTORY_H #define CRYINCLUDE_CRYACTION_SCRIPTBIND_INVENTORY_H #pragma once #include #include struct IItemSystem; struct IGameFramework; class CInventory; class CScriptBind_Inventory : public CScriptableBase { public: CScriptBind_Inventory(ISystem* pSystem, IGameFramework* pGameFramework); virtual ~CScriptBind_Inventory(); void Release() { delete this; }; void AttachTo(CInventory* pInventory); void DetachFrom(CInventory* pInventory); virtual void GetMemoryUsage(ICrySizer* pSizer) const { pSizer->AddObject(this, sizeof(*this)); } //! Inventory.Destroy() //! Destroys the inventory. int Destroy(IFunctionHandler* pH); //! Inventory.Clear() //! Clears the inventory. int Clear(IFunctionHandler* pH); //! Inventory.Dump() //! Dumps the inventory. int Dump(IFunctionHandler* pH); //! Inventory.GetItemByClass( className ) //! Class name. //! Gets item by class name. int GetItemByClass(IFunctionHandler* pH, const char* className); //! Inventory.GetGrenadeWeaponByClass( className ) //! Class name. //! Gets grenade weapon by class name. int GetGrenadeWeaponByClass(IFunctionHandler* pH, const char* className); //! Inventory.HasAccessory( accessoryName ) //! Accessory name. //! Checks if the inventory contains the specified accessory. int HasAccessory(IFunctionHandler* pH, const char* accessoryName); //! Inventory.GetCurrentItemId() //! Gets the identifier of the current item. int GetCurrentItemId(IFunctionHandler* pH); //! Inventory.GetCurrentItem() //! Gets the current item. int GetCurrentItem(IFunctionHandler* pH); //! Inventory.GetAmmoCount(ammoName) //! Ammunition name. //! Gets the amount of the specified ammunition name. int GetAmmoCount(IFunctionHandler* pH, const char* ammoName); //! Inventory.GetAmmoCapacity( ammoName ) //! Ammunition name. //! Gets the capacity for the specified ammunition. int GetAmmoCapacity(IFunctionHandler* pH, const char* ammoName); //! Inventory.SetAmmoCount( ammoName, count ) //! Ammunition name. //! Ammunition amount. //! Sets the amount of the specified ammunition. int SetAmmoCount(IFunctionHandler* pH, const char* ammoName, int count); private: void RegisterGlobals(); void RegisterMethods(); CInventory* GetInventory(IFunctionHandler* pH); ISystem* m_pSystem; IEntitySystem* m_pEntitySystem; IGameFramework* m_pGameFramework; }; #endif // CRYINCLUDE_CRYACTION_SCRIPTBIND_INVENTORY_H