public MyCubeGridSystems(MyCubeGrid grid)
        {
            m_cubeGrid = grid;

            m_terminalSystem_GroupAdded = TerminalSystem_GroupAdded;
            m_terminalSystem_GroupRemoved = TerminalSystem_GroupRemoved;

            ThrustSystem = new MyGridThrustSystem(m_cubeGrid);
            GyroSystem = new MyGridGyroSystem(m_cubeGrid);
            WeaponSystem = new MyGridWeaponSystem();
            ReflectorLightSystem = new MyGridReflectorLightSystem(m_cubeGrid);
            if (MyFakes.ENABLE_WHEEL_CONTROLS_IN_COCKPIT)
            {
                WheelSystem = new MyGridWheelSystem(m_cubeGrid);
            }
            ConveyorSystem = new MyGridConveyorSystem(m_cubeGrid);
            LandingSystem = new MyGridLandingSystem();
            ControlSystem = new MyGroupControlSystem();
            CameraSystem = new MyGridCameraSystem(m_cubeGrid);

            if (MySession.Static.Settings.EnableOxygen)
            {
                OxygenSystem = new MyGridOxygenSystem(m_cubeGrid);
            }
            JumpSystem = new MyGridJumpDriveSystem(m_cubeGrid);

            m_cubeGrid.SyncObject.PowerProducerStateChanged += SyncObject_PowerProducerStateChanged;

            m_blocksRegistered = true;
        }
        public MyCubeGridSystems(MyCubeGrid grid)
        {
            m_cubeGrid = grid;

            m_terminalSystem_GroupAdded   = TerminalSystem_GroupAdded;
            m_terminalSystem_GroupRemoved = TerminalSystem_GroupRemoved;

            ThrustSystem         = new MyGridThrustSystem(m_cubeGrid);
            GyroSystem           = new MyGridGyroSystem(m_cubeGrid);
            WeaponSystem         = new MyGridWeaponSystem();
            ReflectorLightSystem = new MyGridReflectorLightSystem(m_cubeGrid);
            if (MyFakes.ENABLE_WHEEL_CONTROLS_IN_COCKPIT)
            {
                WheelSystem = new MyGridWheelSystem(m_cubeGrid);
            }
            ConveyorSystem = new MyGridConveyorSystem(m_cubeGrid);
            LandingSystem  = new MyGridLandingSystem();
            ControlSystem  = new MyGroupControlSystem();
            CameraSystem   = new MyGridCameraSystem(m_cubeGrid);

            if (MySession.Static.Settings.EnableOxygen)
            {
                OxygenSystem = new MyGridOxygenSystem(m_cubeGrid);
            }
            if (MyPerGameSettings.EnableJumpDrive)
            {
                JumpSystem = new MyGridJumpDriveSystem(m_cubeGrid);
            }

            m_cubeGrid.SyncObject.PowerProducerStateChanged += SyncObject_PowerProducerStateChanged;

            m_blocksRegistered = true;
        }
Example #3
0
        public override void OnRegisteredToGridSystems()
        {
            base.OnRegisteredToGridSystems();

            m_thrustSystem = CubeGrid.GridSystems.ThrustSystem;
        }
Example #4
0
        public override void OnRegisteredToGridSystems()
        {
            base.OnRegisteredToGridSystems();

            m_thrustSystem = CubeGrid.GridSystems.ThrustSystem;
        }
        public override void OnUnregisteredFromGridSystems()
        {
            //System.Diagnostics.Debug.Assert(GridThrustSystem != null);
            //System.Diagnostics.Debug.Assert(GridGyroSystem != null);
            //System.Diagnostics.Debug.Assert(GridWeaponSystem != null);

            if (GridThrustSystem != null)
            {
                ClearMovementControl();
            }

            CubeGrid.AddedToLogicalGroup -= CubeGrid_AddedToLogicalGroup;
            CubeGrid.RemovedFromLogicalGroup -= CubeGrid_RemovedFromLogicalGroup;
            CubeGrid_RemovedFromLogicalGroup();

            GridThrustSystem = null;
            GridGyroSystem = null;
            GridReflectorLights = null;

            base.OnUnregisteredFromGridSystems();
        }
        public override void OnRegisteredToGridSystems()
        {
            GridThrustSystem = CubeGrid.GridSystems.ThrustSystem;
            GridGyroSystem = CubeGrid.GridSystems.GyroSystem;
            GridReflectorLights = CubeGrid.GridSystems.ReflectorLightSystem;

            if (MyFakes.ENABLE_WHEEL_CONTROLS_IN_COCKPIT)
            {
                ControlThrusters = m_controlThrusters;
                ControlWheels = m_controlWheels;
            }

            CubeGrid.AddedToLogicalGroup += CubeGrid_AddedToLogicalGroup;
            CubeGrid.RemovedFromLogicalGroup += CubeGrid_RemovedFromLogicalGroup;
            SetWeaponSystem(CubeGrid.GridSystems.WeaponSystem);

            base.OnRegisteredToGridSystems();
        }