Esempio n. 1
0
 public void UpgradeConverterOutputResource(string resource)
 {
     if (InputOutputMapping.ContainsKey(resource))
     {
         return;
     }
     InputOutputMapping.Add(resource, new List <ResourceAmount>());
     CurrentInput.Add(new ResourceAmount(resource, 0));
 }
Esempio n. 2
0
        public void UpgradeConverterInputMapping(string input, List <ResourceAmount> outputResourceAmounts)
        {
            if (!(AllInputOutputMapping.ContainsKey(input) && InputOutputMapping.ContainsKey(input)))
            {
                throw new Exception("Input not found in inputoutput mapping");
            }
            foreach (var item in outputResourceAmounts)
            {
                if (!AllInputOutputMapping[input].Any(m => m.Type == item.Type))
                {
                    throw new Exception("Output resource not found in inputoutput mapping");
                }
            }

            InputOutputMapping[input].AddRange(outputResourceAmounts);
        }