Example #1
0
 public void ClearOldData()
 {
     FurnaceControllerId.Clear();
     FurnaceControllerCurrentlyOn.Clear();
     FurnaceControllerInput.Clear();
     FurnaceControllerOutput.Clear();
 }
Example #2
0
        /// <summary>Parses the save data from the furnace controller data</summary>
        public void ParseControllersToModSaveData(List <IndustrialFurnaceController> furnaces)
        {
            for (int i = 0; i < furnaces.Count; i++)
            {
                FurnaceControllerId.Add(furnaces[i].ID);
                FurnaceControllerCurrentlyOn.Add(furnaces[i].CurrentlyOn);

                Dictionary <int, int> inputChest = new Dictionary <int, int>();

                for (int j = 0; j < furnaces[i].input.items.Count; j++)
                {
                    Item tempItem = furnaces[i].input.items[j];

                    if (inputChest.ContainsKey(tempItem.ParentSheetIndex))
                    {
                        inputChest[tempItem.ParentSheetIndex] += tempItem.Stack;
                    }
                    else
                    {
                        inputChest.Add(tempItem.ParentSheetIndex, tempItem.Stack);
                    }
                }

                FurnaceControllerInput.Add(inputChest);


                Dictionary <int, int> outputChest = new Dictionary <int, int>();

                for (int j = 0; j < furnaces[i].output.items.Count; j++)
                {
                    Item tempItem = furnaces[i].output.items[j];

                    if (outputChest.ContainsKey(tempItem.ParentSheetIndex))
                    {
                        outputChest[tempItem.ParentSheetIndex] += tempItem.Stack;
                    }
                    else
                    {
                        outputChest.Add(tempItem.ParentSheetIndex, tempItem.Stack);
                    }
                }

                FurnaceControllerOutput.Add(outputChest);
            }
        }