/* * 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. #ifndef CRYINCLUDE_CRYACTION_SCRIPTBIND_ITEMSYSTEM_H #define CRYINCLUDE_CRYACTION_SCRIPTBIND_ITEMSYSTEM_H #pragma once #include #include class CItemSystem; class CEquipmentManager; class CScriptBind_ItemSystem : public CScriptableBase { public: CScriptBind_ItemSystem(ISystem* pSystem, CItemSystem* pItemSystem, IGameFramework* pGameFramework); virtual ~CScriptBind_ItemSystem(); void Release() { delete this; }; virtual void GetMemoryUsage(ICrySizer* pSizer) const { pSizer->AddObject(this, sizeof(*this)); } //! ItemSystem.Reset() //! Resets the item system. int Reset(IFunctionHandler* pH); //! ItemSystem.GiveItem( itemName ) //! Item name. //! Gives the specified item. int GiveItem(IFunctionHandler* pH, const char* itemName); //! ItemSystem.GiveItemPack( actorId, packName ) //! Actor identifier. //! Pack name. //! Gives the item pack to the specified actor. int GiveItemPack(IFunctionHandler* pH, ScriptHandle actorId, const char* packName); //! ItemSystem.GetPackPrimaryItem( packName ) //! Pack name. //! Gets the primary item of the specified pack. int GetPackPrimaryItem(IFunctionHandler* pH, const char* packName); //! ItemSystem.GetPackNumItems() //! Get the number of items in the specified pack. //! Pack name. int GetPackNumItems(IFunctionHandler* pH, const char* packName); //! ItemSystem.GetPackItemByIndex( packName, index ) //! Pack name. //! Pack index. //! Gets a pack item from its index. int GetPackItemByIndex(IFunctionHandler* pH, const char* packName, int index); //! ItemSystem.SetActorItem( actorId, itemId, keepHistory ) //! Actor identifier. //! Item identifier. //! True to keep history, false otherwise. //! Sets an actor item. int SetActorItem(IFunctionHandler* pH, ScriptHandle actorId, ScriptHandle itemId, bool keepHistory); //! ItemSystem.SetActorItemByName( actorId, name, keepHistory ) //! Actor identifier. //! Actor item name. //! True to keep history, false otherwise. //! Sets an actor item by name. int SetActorItemByName(IFunctionHandler* pH, ScriptHandle actorId, const char* name, bool keepHistory); //! ItemSystem.SerializePlayerLTLInfo( reading ) //! Boolean value. //! Serializes player LTL info. int SerializePlayerLTLInfo(IFunctionHandler* pH, bool reading); private: void RegisterGlobals(); void RegisterMethods(); CItemSystem* m_pItemSystem; IGameFramework* m_pGameFramework; CEquipmentManager* m_pEquipmentManager; }; #endif // CRYINCLUDE_CRYACTION_SCRIPTBIND_ITEMSYSTEM_H