protected override bool BlueprintClassCanBeUsed(MyBlueprintClassDefinition blueprintClass)
        {
            foreach (var blueprint in blueprintClass)
            {
                if (blueprint.Atomic)
                {
                    System.Diagnostics.Debug.Assert(false, "Blueprint " + blueprint.DisplayNameText + " is atomic, but it is in a class used by refinery block");
                    MySandboxGame.Log.WriteLine("Blueprint " + blueprint.DisplayNameText + " is atomic, but it is in a class used by refinery block");
                    return(false);
                }
            }

            return(base.BlueprintClassCanBeUsed(blueprintClass));
        }
Exemple #2
0
 protected override bool BlueprintClassCanBeUsed(MyBlueprintClassDefinition blueprintClass)
 {
     using (IEnumerator <MyBlueprintDefinitionBase> enumerator = blueprintClass.GetEnumerator())
     {
         while (true)
         {
             if (!enumerator.MoveNext())
             {
                 break;
             }
             MyBlueprintDefinitionBase current = enumerator.Current;
             if (current.Atomic)
             {
                 MySandboxGame.Log.WriteLine("Blueprint " + current.DisplayNameText + " is atomic, but it is in a class used by refinery block");
                 return(false);
             }
         }
     }
     return(base.BlueprintClassCanBeUsed(blueprintClass));
 }
Exemple #3
0
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);
            MyObjectBuilder_ProductionBlockDefinition ob = builder as MyObjectBuilder_ProductionBlockDefinition;

            this.InventoryMaxVolume          = ob.InventoryMaxVolume;
            this.InventorySize               = ob.InventorySize;
            this.ResourceSinkGroup           = MyStringHash.GetOrCompute(ob.ResourceSinkGroup);
            this.StandbyPowerConsumption     = ob.StandbyPowerConsumption;
            this.OperationalPowerConsumption = ob.OperationalPowerConsumption;
            if (ob.BlueprintClasses == null)
            {
                this.InitializeLegacyBlueprintClasses(ob);
            }
            this.BlueprintClasses = new List <MyBlueprintClassDefinition>();
            foreach (string str in ob.BlueprintClasses)
            {
                MyBlueprintClassDefinition blueprintClass = MyDefinitionManager.Static.GetBlueprintClass(str);
                if (blueprintClass != null)
                {
                    this.BlueprintClasses.Add(blueprintClass);
                }
            }
        }
 protected virtual bool BlueprintClassCanBeUsed(MyBlueprintClassDefinition blueprintClass)
 {
     return(true);
 }
Exemple #5
0
 protected virtual bool BlueprintClassCanBeUsed(MyBlueprintClassDefinition blueprintClass) =>
 true;