public BoxStack_s MakeSerializable() { List <Product_s> serializableBoxList = new List <Product_s>(); foreach (Box box in boxList) { List <Product_s> boxProducts = new List <Product_s>(); StorageBox storageBox = (StorageBox)box.product; Product_s newStorageBox_s = storageBox.MakeSerializable(); serializableBoxList.Add(newStorageBox_s); } BoxStack_s toReturn = new BoxStack_s(uniqueID, transform.position, transform.eulerAngles, serializableBoxList); return(toReturn); }
public Inventory_s MakeSerializable() { List <StoredProduct_s> productList = new List <StoredProduct_s>(); RefreshInventoryList(true); foreach (StoredProduct product in allProduct) { StoredProduct_s toAdd = product.MakeSerializable(); productList.Add(toAdd); } List <ContainerReference_s> containerList = new List <ContainerReference_s>(); foreach (ContainerReference container in containersInStorage) { ContainerReference_s toAdd = container.MakeSerializable(); containerList.Add(toAdd); } List <StoredStoreObjectReference_s> storeObjectList = new List <StoredStoreObjectReference_s>(); foreach (StoredStoreObjectReference storeObject in storeObjectsInStorage) { StoredStoreObjectReference_s toAdd = storeObject.MakeSerializable(); storeObjectList.Add(toAdd); } List <BoxStack_s> boxStackList = new List <BoxStack_s>(); foreach (BoxStack boxStack in looseBoxes) { BoxStack_s toAdd = boxStack.MakeSerializable(); boxStackList.Add(toAdd); } Inventory_s toReturn = new Inventory_s(productList, containerList, storeObjectList, boxStackList); toReturn.inventoryVisibleData = inventoryVisibleData; return(toReturn); }