Пример #1
0
        public void SetThrustersEnabled(VRageMath.Vector3 dir, bool value)
        {
            if (!thrusterBlocks.ContainsKey(dir))
            {
                throw new Exception("Warning! No thruster in direction " + dir + ".");
            }

            var list = thrusterBlocks[dir];

            for (int i = 0; i < list.Count; ++i)
            {
                IMyThrust block = list[i];
                if (block.Enabled ^ value)
                {
                    block.GetActionWithName("OnOff").Apply(block);
                }
            }
        }
Пример #2
0
        public void ApplyAction(VRageMath.Vector3 dir, string name)
        {
            if (!XUtils.Directions.Contains(dir))
            {
                throw new Exception("Invalid direction vector used: " + dir);
            }

            VRageMath.Matrix local = new VRageMath.Matrix();
            referenceBlock.Orientation.GetMatrix(out local);
            dir = VRageMath.Vector3.Transform(dir, local);

            var list = thrusterBlocks[dir];

            for (int i = 0; i < list.Count; ++i)
            {
                IMyThrust thruster = list[i];
                thruster.GetActionWithName(name).Apply(thruster);
            }
        }