コード例 #1
0
        public static RustInventory fromInventory(PlayerInventory invent)
        {
            RustInventory rustyCoreInventory = new RustInventory()
            {
                containerBelt = RustItemContainer.fromContainer(invent.containerBelt, "belt"),
                containerMain = RustItemContainer.fromContainer(invent.containerMain, "main"),
                containerWear = RustItemContainer.fromContainer(invent.containerWear, "wear")
            };

            invent.Strip();
            return(rustyCoreInventory);
        }
コード例 #2
0
        public static RustItemContainer fromContainer(ItemContainer cont, string pType)
        {
            RustItemContainer itemContainer = new RustItemContainer(cont.itemList.Count)
            {
                type = pType
            };

            for (int i = 0; i < itemContainer.container.Count <RustItem>(); i++)
            {
                itemContainer.container[i] = RustItem.fromItem(cont.itemList[i], pType);
            }
            return(itemContainer);
        }