Пример #1
0
 public int this[MyItemType type]
 {
     get { return(DesiredStock[type]); }
     set
     {
         if (!Blueprints.ContainsKey(type))
         {
             MyDefinitionId?bp = CreateBlueprint(type.SubtypeId);
             if (!bp.HasValue)
             {
                 throw new ArgumentException($"Failed to create blueprint for {type.ToString()}");
             }
             Blueprints[type]            = bp.Value;
             InverseBlueprints[bp.Value] = type;
         }
         DesiredStock[type] = value;
     }
 }