You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw/apps/openmw/mwlua/types/item.cpp

23 lines
678 B
C++

#include <sol/sol.hpp>
#include "../../mwworld/class.hpp"
#include "../itemdata.hpp"
#include "types.hpp"
namespace MWLua
{
void addItemBindings(sol::table item, const Context& context)
{
item["getEnchantmentCharge"]
= [](const Object& object) { return object.ptr().getCellRef().getEnchantmentCharge(); };
item["setEnchantmentCharge"]
= [](const GObject& object, float charge) { object.ptr().getCellRef().setEnchantmentCharge(charge); };
item["isRestocking"]
= [](const Object& object) -> bool { return object.ptr().getCellRef().getCount(false) < 0; };
addItemDataBindings(item, context);
}
}