Exemple #1
0
        private void Init()
        {
            MyProperty = new KProperty(this);
            MyProperty.Load();
            Stage          = 0;
            bottom_pistons = BlockSystem <IMyPistonBase> .SearchByGroup(this, "Foreuse Bottom Pistons");

            bottom_pistons.ForEach(delegate(IMyPistonBase block) {
                block.MinLimit = MyProperty.locker_position_min;
                block.MaxLimit = MyProperty.locker_position_max;
            });
            bottom_mergers = BlockSystem <IMyShipMergeBlock> .SearchByGroup(this, "Foreuse Bottom Mergers");

            top_pistons = BlockSystem <IMyPistonBase> .SearchByGroup(this, "Foreuse Top Pistons");

            top_pistons.ForEach(delegate(IMyPistonBase block) {
                block.MinLimit = MyProperty.locker_position_min;
                block.MaxLimit = MyProperty.locker_position_max;
            });
            top_mergers = BlockSystem <IMyShipMergeBlock> .SearchByGroup(this, "Foreuse Top Mergers");

            connector = BlockSystem <IMyShipConnector> .SearchByName(this, "Foreuse Connector Drills");

            levage_pistons = BlockSystem <IMyPistonBase> .SearchByGroup(this, "Foreuse Levage Pistons");

            levage_pistons.ForEach(delegate(IMyPistonBase block) {
                block.MinLimit = MyProperty.elevator_position_min;
                block.MaxLimit = MyProperty.elevator_position_max;
            });

            grinder_stator = BlockSystem <IMyMotorStator> .SearchByName(this, "Foreuse Grinder Stator");

            grinders = BlockSystem <IMyShipGrinder> .SearchByGroup(this, "Foreuse Grinders");

            welder_stator = BlockSystem <IMyMotorStator> .SearchByName(this, "Foreuse Welder Stator");

            welders = BlockSystem <IMyShipWelder> .SearchByGroup(this, "Foreuse Welders");

            projector = BlockSystem <IMyProjector> .SearchByName(this, "Foreuse Projector Drill");

            light = BlockSystem <IMyLightingBlock> .SearchByGroup(this, "Foreuse Rotating Light");

            drills = BlockSystem <IMyShipDrill> .SearchByGroup(this, "Foreuse Drills");

            control_lcds = BlockSystem <IMyTextPanel> .SearchByName(this, "Foreuse Control LCD");

            control_lcds.ForEach(delegate(IMyTextPanel block)
            {
                block.ContentType = ContentType.TEXT_AND_IMAGE;
            });

            SequenceBlocks = new List <int>()
            {
            };
        }
Exemple #2
0
        public Program()
        {
            MyProperty = new KProperty(this);
            MyProperty.Load();
            drawingSurface             = Me.GetSurface(0);
            drawingSurface.ContentType = ContentType.TEXT_AND_IMAGE;
            Runtime.UpdateFrequency    = UpdateFrequency.Update100;

            lat_stators = BlockSystem <IMyMotorStator> .SearchByName(this, MyProperty.Name);

            if (!lat_stators.IsEmpty)
            {
                lon_stators = BlockSystem <IMyMotorStator> .SearchByGrid(this, lat_stators.First.Top.CubeGrid);

                solar_panels = new BlockSystem <IMySolarPanel>();
                foreach (IMyMotorStator lon_stator in lon_stators.List)
                {
                    solar_panels.Merge(BlockSystem <IMySolarPanel> .SearchByGrid(this, lon_stator.Top.CubeGrid));
                }
            }
        }