Esempio n. 1
0
 public DrillTower(PistonStack[] pistonStacks, DrillHead drillHead, ClampGroup clampGroup, IMyMotorStator rotor, LightGroup lights, IMyTextPanel display)
 {
     this.pistonGroup = new PistonGroup(pistonStacks, Constants.DRILL_EXTENSION_SPEED_METRES_PER_SECOND, Constants.DRILL_RETRACTION_SPEED_METRES_PER_SECOND);
     this.drillHead   = drillHead;
     this.clampGroup  = clampGroup;
     this.rotor       = rotor;
     this.lights      = lights;
     this.Display     = display;
 }
Esempio n. 2
0
        public DrillTower Build(StaticState.DrillTowerDef definition)
        {
            gridTerminalSystem.GetBlockGroupWithName(definition.PistonGroupName)?.GetBlocksOfType(local_static_pistons);
            gridTerminalSystem.GetBlockGroupWithName(definition.DrillGroupName)?.GetBlocksOfType(local_static_drills);
            gridTerminalSystem.GetBlockGroupWithName(definition.DrillClampsGroupName)?.GetBlocksOfType(local_static_clamps);
            gridTerminalSystem.GetBlocksOfType(local_static_floodlights, b => b.CustomName == definition.FloodlightsName);
            var rotor   = gridTerminalSystem.GetBlockWithName(definition.RotorName) as IMyMotorStator;
            var display = gridTerminalSystem.GetBlockWithName(definition.DisplayName) as IMyTextPanel;

            var stacks = new PistonTopology().GetPistonStacks(local_static_pistons);
            var drills = new DrillHead(local_static_drills.ToArray());
            var clamps = new ClampGroup(local_static_clamps.ToArray());
            var lights = new LightGroup(local_static_floodlights.ToArray());

            return(new DrillTower(stacks, drills, clamps, rotor, lights, display));
        }