예제 #1
0
        private void Event_DrawControl(object sender, PaintEventArgs e)
        {
            if (DebugTools.IsInDesignMode())
            {
                return;
            }

            Image image = new Bitmap(Width, Height);

            var graphics = Graphics.FromImage(image);

            graphics.CompositingQuality = CompositingQuality.HighQuality;
            graphics.InterpolationMode  = InterpolationMode.Bicubic;
            graphics.SmoothingMode      = SmoothingMode.AntiAlias;
            graphics.TextRenderingHint  = TextRenderingHint.AntiAlias;

            var currentTurnBoardInfo = new BoardInfo
            {
                GraphicSurface = graphics,
                ScreenInfo     = _screenParameters,
                TurnInfo       = null,
                TurnStep       = 1
            };

            DrawMapTools.DrawGrid(currentTurnBoardInfo);

            BackgroundImage = image;
        }
예제 #2
0
        private void DrawTacticalMapScreen()
        {
            Logger.Debug(TraceMessage.Execute(this, $"Turn { _gameSession.Turn}.{turnStep}"));

            Image image = new Bitmap(Width, Height);

            var graphics = Graphics.FromImage(image);

            graphics.CompositingQuality = CompositingQuality.HighQuality;
            graphics.InterpolationMode  = InterpolationMode.Bicubic;
            graphics.SmoothingMode      = SmoothingMode.AntiAlias;
            graphics.TextRenderingHint  = TextRenderingHint.AntiAlias;

            var currentTurnBoardInfo = new BoardInfo
            {
                GraphicSurface = graphics,
                ScreenInfo     = _screenParameters,
                TurnInfo       = granularTurnInformation,
                TurnStep       = turnStep
            };


            DrawMapTools.DrawGrid(currentTurnBoardInfo);

            DrawMapTools.DrawSelectedObject(graphics, _mode, _gameSession, MouseMoveCelestialObject, _connectorsSelect, granularTurnInformation, turnStep, _screenParameters);

            DrawMapTools.DrawConnectors(graphics, _gameSession, _connectorsShow, granularTurnInformation, turnStep, _screenParameters);

            DrawMapTools.DrawConnectors(graphics, _gameSession, _connectorsSelect, granularTurnInformation, turnStep, _screenParameters);

            DrawMapTools.DrawDestinationPoint(graphics, _gameSession, destinationPoint, _screenParameters);

            DrawMapTools.DrawChangeMovementDestination(graphics, _gameSession, pointInSpace, granularTurnInformation, turnStep, _screenParameters);

            DrawMapTools.DrawSpaceShipMovement(graphics, _gameSession, granularTurnInformation, turnStep, HistoryMovementLog, _screenParameters);

            DrawMapTools.DrawMissiles(graphics, _gameSession, granularTurnInformation, turnStep, _screenParameters);

            DrawMapTools.DrawExplosions(graphics, _gameSession, granularTurnInformation, turnStep, _screenParameters);

            DrawMapTools.DrawSpaceShipTrajectories(graphics, _gameSession, granularTurnInformation, _screenParameters);

            DrawMapTools.DrawScreen(graphics, _gameSession, granularTurnInformation, turnStep, _screenParameters);

            DrawMapTools.DrawActiveModule(graphics, _activeModule, mouseCoordinates, _gameSession, granularTurnInformation, turnStep, _screenParameters);

            DrawMapTools.DrawMouseMoveObject(graphics, _gameSession, MouseMoveCelestialObject, granularTurnInformation, turnStep, _screenParameters);



            BackgroundImage = image;
        }
예제 #3
0
        private void RefreshSelectedInfoControl(ICelestialObject celestialObject, SortedDictionary <int, GranularObjectInformation> granularObjectInformations, int i)
        {
            if (celestialObject == null)
            {
                OnRefreshSelectedCelestialObject?.Invoke(null, null);

                return;
            }

            var location = DrawMapTools.GetCurrentLocation(granularTurnInformation, celestialObject, turnStep, _screenParameters.DrawInterval);

            var selectedCelestialObject = celestialObject.DeepClone();

            selectedCelestialObject.PositionX = location.X;
            selectedCelestialObject.PositionY = location.Y;

            OnRefreshSelectedCelestialObject?.Invoke(selectedCelestialObject, _gameSession.GetPlayerSpaceShip());
        }