Exemplo n.º 1
0
        public MyCubeGridSystems(MyCubeGrid grid)
        {
            m_cubeGrid = grid;

            m_terminalSystem_GroupAdded = TerminalSystem_GroupAdded;
            m_terminalSystem_GroupRemoved = TerminalSystem_GroupRemoved;

            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)
            {
                GasSystem = new MyGridGasSystem(m_cubeGrid);
            }
            if (MyPerGameSettings.EnableJumpDrive)
            {
                JumpSystem = new MyGridJumpDriveSystem(m_cubeGrid);
            }
            if (MyPerGameSettings.EnableShipSoundSystem && (MyFakes.ENABLE_NEW_SMALL_SHIP_SOUNDS || MyFakes.ENABLE_NEW_LARGE_SHIP_SOUNDS) && MySandboxGame.IsDedicated == false)
            {
                ShipSoundComponent = new MyShipSoundComponent();
            }

            m_blocksRegistered = true;
        }
Exemplo n.º 2
0
        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;

            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)
            {
                GasSystem = new MyGridGasSystem(m_cubeGrid);
            }
            if (MyPerGameSettings.EnableJumpDrive)
            {
                JumpSystem = new MyGridJumpDriveSystem(m_cubeGrid);
            }

            m_blocksRegistered = true;
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        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();
        }