示例#1
0
            //            public List<IMyTerminalBlock> Gyros = new List<IMyTerminalBlock>();
            //            public List<IMyGyro> Gyros = new List<IMyGyro>();

            public void SetYaw(float yaw)
            {
                //                for (int i = 0; i < Gyros.Count; i++)
                if (useGyros.Count < 1)
                {
                    GyroSetup();
                }
                ApplyGyroOverride(0, yaw, 0, useGyros, _wicoBlockMaster.GetMainController());
            }
示例#2
0
            void OreFound(int oreIndex)
            {
                //            Echo("FIRST FIND!:" + oreInfos[oreIndex].oreName);
                if (oreInfos[oreIndex].desireability > 0)
                {
                    // add ore found loc...
                    MatrixD refOrientation = new MatrixD();
                    refOrientation = _wicoBlockMaster.GetMainController().WorldMatrix;

                    //                MatrixD refOrientation = GetBlock2WorldTransform(shipOrientationBlock);
                    Vector3D vVec = Vector3D.Normalize(refOrientation.Forward);

                    // but only if we got it inside asteroid.
                    long astEntity = _asteroids.AsteroidFindNearest(true);
                    if (astEntity > 0)
                    {
                        //                    sInitResults += "\nOreAddLoc for  oreid=" + oreIndex.ToString();
                        OreAddLoc(astEntity, oreIndex, _wicoBlockMaster.GetMainController().GetPosition(), vVec, 69);
                    }
                    //                sInitResults += "\nNo Asteroid found for oreid=" + oreIndex.ToString();
                }
            }
示例#3
0
 public IEnumerator <bool> PostInitHandler()
 {
     shipController = _wicoBlockMaster.GetMainController();
     SensorInit(shipController);
     yield return(false);
 }
示例#4
0
        public Program()
        {
            MyIniParseResult result;

            if (!_CustomDataIni.TryParse(Me.CustomData, out result))
            {
                Me.CustomData = "";
                _CustomDataIni.Clear();
                Echo(result.ToString());
                //throw new Exception(result.ToString());
            }
            if (!_SaveIni.TryParse(Storage, out result))
            {
                Storage = "";
                _SaveIni.Clear();
                Echo(result.ToString());
                //                throw new Exception(result.ToString());
            }

            wicoIGC         = new WicoIGC(this);         // Must be first as some use it in constructor
            wicoBlockMaster = new WicoBlockMaster(this); // must be before any other block-oriented modules
            wicoControl     = new WicoControl(this);

//            wicoTravelMovement = new TravelMovement(this);

            wicoThrusters    = new WicoThrusters(this);
            wicoGyros        = new WicoGyros(this, null);
            wicoGasTanks     = new GasTanks(this);
            wicoGasGens      = new GasGens(this);
            wicoConnectors   = new Connectors(this);
            wicoLandingGears = new LandingGears(this);
            wicoCameras      = new Cameras(this);
            wicoParachutes   = new Parachutes(this);
            wicoNavRotors    = new NavRotors(this);
            wicoAntennas     = new Antennas(this);
            wicoSensors      = new Sensors(this, wicoBlockMaster.GetMainController());
            wicoWheels       = new Wheels(this);

            wicoOrbitalLaunch = new OrbitalModes(this);
//            wicoNavigation = new Navigation(this, wicoBlockMaster.GetMainController());

            Runtime.UpdateFrequency |= UpdateFrequency.Once; // cause ourselves to run again to continue initialization

            // Local PB Surface Init
            mesurface0             = Me.GetSurface(0);
            mesurface1             = Me.GetSurface(1);
            mesurface0.ContentType = VRage.Game.GUI.TextPanel.ContentType.TEXT_AND_IMAGE;
            mesurface0.WriteText("Wicorel Modular");
            mesurface0.FontSize  = 2;
            mesurface0.Alignment = VRage.Game.GUI.TextPanel.TextAlignment.CENTER;

            mesurface1.ContentType = VRage.Game.GUI.TextPanel.ContentType.TEXT_AND_IMAGE;
            mesurface1.WriteText("Version: 1");
            mesurface1.Alignment   = VRage.Game.GUI.TextPanel.TextAlignment.CENTER;
            mesurface1.TextPadding = 0.25f;
            mesurface1.FontSize    = 3.5f;

            if (!Me.Enabled)
            {
                Echo("I am turned OFF!");
            }
        }
示例#5
0
 void PostInitHandler()
 {
     shipController = _wicoBlockMaster.GetMainController();
 }