Пример #1
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 override void InitializeLegacyBlueprintClasses(MyObjectBuilder_ProductionBlockDefinition ob)
 {
     ob.BlueprintClasses = new string[] { "Ingots" };
 }
 protected override void InitializeLegacyBlueprintClasses(MyObjectBuilder_ProductionBlockDefinition ob)
 {
     ob.BlueprintClasses = new string[] { "LargeBlocks", "SmallBlocks", "Components", "Tools" };
 }
 // A legacy function to ensure that the old mods work with new blueprint system
 protected virtual void InitializeLegacyBlueprintClasses(MyObjectBuilder_ProductionBlockDefinition ob)
 {
     ob.BlueprintClasses = new string[0];
 }
 protected override void InitializeLegacyBlueprintClasses(MyObjectBuilder_ProductionBlockDefinition ob)
 {
     ob.BlueprintClasses = new string[] { "LargeBlocks", "SmallBlocks", "Components", "Tools" };
 }
Пример #6
0
 protected override void InitializeLegacyBlueprintClasses(MyObjectBuilder_ProductionBlockDefinition ob)
 {
     ob.BlueprintClasses = new string[] { "Ingots" };
 }
 // A legacy function to ensure that the old mods work with new blueprint system
 protected virtual void InitializeLegacyBlueprintClasses(MyObjectBuilder_ProductionBlockDefinition ob) { ob.BlueprintClasses = new string[0]; }