Exemple #1
0
        public void Update(IGameTimeService gameTime)
        {
            Camera.Pos = ConvertUnits.ToDisplayUnits(_clientShipManager.PlayerShip.Position);
            Camera.UpdateCameraShake();

            // Todo: See if zooming in space is broken, if it is, then finish refactoring RotationalCamera away.
            //Temporary fix for now, it was broken.
            if (MouseManager.ScrolledUp || GamepadManager.ZoomIn.IsBindTapped())
            {
                ConsoleManager.WriteLine("Warning: Implement UI Zoom using ChangeZoom container.");
                Camera.Zoom += .1f;
            }

            if (MouseManager.ScrolledDown || GamepadManager.ZoomOut.IsBindTapped())
            {
                ConsoleManager.WriteLine("Warning: Implement UI Zoom using ChangeZoom container.");
                Camera.Zoom -= .1f;
            }


            if (_spaceViewModel.StructurePlacementModeEnabled)
            {
                if (MouseManager.RightButtonPressed)
                {
                    // Cancel with right click
                    _spaceViewModel.StructurePlacementModeEnabled = false;
                }
            }

            if (_clientShipManager.PlayerShip != null)
            {
                var shipDifference = _oldPosition - ConvertUnits.ToDisplayUnits(_clientShipManager.PlayerShip.Position);

                _background.Update(_clientShipManager.PlayerShip.Position, shipDifference);

                _spaceObjectManager.Update(gameTime, _clientShipManager.PlayerShip != null && _clientShipManager.PlayerShip.EnterMode);

                _oldPosition = ConvertUnits.ToDisplayUnits(_clientShipManager.PlayerShip.Position);
            }
        }