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); }
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); }