Exemplo n.º 1
0
        private void drawSystems()
        {
            //Draw every system
            foreach (StarSystem point in Interface.GameManager.Systems)
            {
                Point relativePos = point.MapCoord;
                relativePos.X += (int)(mapOffset.X / GraphicConsole.BufferWidth);
                relativePos.Y += (int)(mapOffset.Y / GraphicConsole.BufferWidth);

                GraphicConsole.SetColor(point.StarColor, Color4.Black);
                GraphicConsole.Put('☼', relativePos.X + Position.X, relativePos.Y + Position.Y);
            }

            //Draw current system
            Point systemPos = currentSystem.MapCoord;

            systemPos.X += (int)(mapOffset.X / GraphicConsole.BufferWidth);
            systemPos.Y += (int)(mapOffset.Y / GraphicConsole.BufferWidth);

            GraphicConsole.SetColor(Color4.Black, currentSystem.StarColor);
            GraphicConsole.Put('☼', systemPos.X + Position.X, systemPos.Y + Position.Y);

            if (drawSelectedSystem)
            {
                Point relativePos = selectedSystem.MapCoord;
                relativePos.X += (int)(mapOffset.X / GraphicConsole.BufferWidth);
                relativePos.Y += (int)(mapOffset.Y / GraphicConsole.BufferWidth);

                GraphicConsole.SetColor(Color4.Black, selectedSystem.StarColor);
                GraphicConsole.Put('☼', relativePos.X + Position.X, relativePos.Y + Position.Y);
            }

            GraphicConsole.ClearColor();
        }
Exemplo n.º 2
0
        public override void DrawStep()
        {
            this.drawRail();

            GraphicConsole.SetColor(this.barColor, this.fillColor);
            GraphicConsole.Put(this.barToken, this.barPosition.X, this.barPosition.Y);

            base.DrawStep();
        }
Exemplo n.º 3
0
        public override void DrawStep()
        {
            for (int i = 0; i < stars.Count; i++)
            {
                GraphicConsole.SetColor(stars[i].Color, Color4.Black);
                GraphicConsole.Put('.', stars[i].X, stars[i].Y);
            }
            GraphicConsole.ClearColor();

            base.DrawStep();
        }
Exemplo n.º 4
0
        private void drawShips()
        {
            List <Ship> shipsInRange = Interface.GameManager.GetShipsInJumpRadius(Interface.GameManager.PlayerShip);

            foreach (Ship ship in shipsInRange)
            {
                Point point = getScreenPosFromCoord(getCoordFromWorldPos(ship.WorldPosition));

                GraphicConsole.SetColor(ship.Faction.RegionColor, Color4.Black);
                GraphicConsole.Put('.', point);
            }
        }
Exemplo n.º 5
0
        private void drawBorder(Rectangle mapBounds)
        {
            GraphicConsole.Draw.Line(mapBounds.Left, mapBounds.Top, mapBounds.Left, mapBounds.Bottom, '│');
            GraphicConsole.Draw.Line(mapBounds.Right, mapBounds.Top, mapBounds.Right, mapBounds.Bottom, '│');
            GraphicConsole.Draw.Line(mapBounds.Left, mapBounds.Top, mapBounds.Right, mapBounds.Top, '─');
            GraphicConsole.Draw.Line(mapBounds.Left, mapBounds.Bottom, mapBounds.Right, mapBounds.Bottom, '─');

            GraphicConsole.Put('┌', mapBounds.Left, mapBounds.Top);
            GraphicConsole.Put('┐', mapBounds.Right, mapBounds.Top);
            GraphicConsole.Put('└', mapBounds.Left, mapBounds.Bottom);
            GraphicConsole.Put('┘', mapBounds.Right, mapBounds.Bottom);
        }
Exemplo n.º 6
0
        public override void DrawStep()
        {
            Rectangle mapBounds = new Rectangle(Position, new Size(Size));

            GraphicConsole.SetBounds(mapBounds);

            Vector2 origin = Vector2.Zero;

            origin.X += mapOffset.X / GraphicConsole.BufferWidth;
            origin.Y += mapOffset.Y / GraphicConsole.BufferWidth;

            int x = (int)(origin.X + mapBounds.X);
            int y = (int)(origin.Y + mapBounds.Y);

            GraphicConsole.SetColor(axisColor, Color4.Black);
            GraphicConsole.Draw.Line(x, mapBounds.Top + 1, x, mapBounds.Bottom - 1, '·');
            GraphicConsole.Draw.Line(mapBounds.Left + 1, y, mapBounds.Right - 1, y, '·');
            GraphicConsole.SetCursor(x + 1, y - 1);
            GraphicConsole.ClearColor();

            double travelRadius = Interface.GameManager.PlayerShip.JumpRadius;
            int    r            = (int)(travelRadius / GraphicConsole.BufferWidth);

            Point playerPos = getScreenPosFromCoord(getCoordFromWorldPos(Interface.GameManager.PlayerShip.WorldPosition));

            GraphicConsole.SetColor(Color4.Gray, Color4.Black);
            GraphicConsole.Draw.Circle(playerPos.X, playerPos.Y, r, '·');

            if (drawSelectedSystem)
            {
                drawPaths();
            }
            drawShips();
            drawSystems();
            drawFactions();

            GraphicConsole.ClearBounds();
            GraphicConsole.ClearColor();

            drawBorder(mapBounds);

            if (DrawPlayerPosition)
            {
                GraphicConsole.SetColor(Color4.Red, Color4.Black);
                GraphicConsole.Put('@', playerPos);
            }

            GraphicConsole.ClearColor();
            base.DrawStep();
        }
Exemplo n.º 7
0
        public override void DrawStep()
        {
            GraphicConsole.SetColor(Color4.Transparent, FillColor);
            GraphicConsole.Draw.Rect(Position.X, Position.Y, Size.X, Size.Y, ' ', true);

            GraphicConsole.SetColor(Color4.Transparent, StripeColor);
            for (int x = Position.X + Size.X - 1; x >= Position.X; x -= 5)
            {
                GraphicConsole.Draw.Line(x, Position.Y, x, Position.Y + Size.Y - 1, ' ');
            }

            if (faction == null)
            {
                return;
            }

            int scaleX = 5;
            int scaleY = max(0, 100) / (Size.Y - 1);

            if (scaleY == 0)
            {
                return;              //Prevent divide by zero exception
            }
            int loop = 0;

            for (int i = faction.StockPrices.Count - 1; i > 0 && loop < Size.X / 5; i--)
            {
                int x0 = (Position.X + Size.X - 1) - loop * scaleX;
                int x1 = (Position.X + Size.X - 1) - (loop + 1) * scaleX;

                int y0 = (Position.Y + Size.Y - 1) - faction.StockPrices[i] / scaleY;
                int y1 = (Position.Y + Size.Y - 1) - faction.StockPrices[i - 1] / scaleY;

                GraphicConsole.SetColor(faction.RegionColor, FillColor);
                GraphicConsole.Draw.Line(x0, y0, x1, y1, '.');

                GraphicConsole.SetColor(faction.RegionColor, StripeColor);
                GraphicConsole.Put('*', x0, y0);
                GraphicConsole.Put('*', x1, y1);

                loop++;
            }

            GraphicConsole.ClearColor();

            base.DrawStep();
        }
Exemplo n.º 8
0
        private void drawBorders()
        {
            GraphicConsole.Draw.Line(0, 0, 0, GraphicConsole.BufferHeight - 1, '║');
            GraphicConsole.Draw.Line(GraphicConsole.BufferWidth - 1, 0, GraphicConsole.BufferWidth - 1, GraphicConsole.BufferHeight - 1, '║');
            GraphicConsole.Draw.Line(0, 0, GraphicConsole.BufferWidth - 1, 0, '═');
            GraphicConsole.Draw.Line(0, GraphicConsole.BufferHeight - 1, GraphicConsole.BufferWidth - 1, GraphicConsole.BufferHeight - 1, '═');

            GraphicConsole.Put('╔', 0, 0);
            GraphicConsole.Put('╗', GraphicConsole.BufferWidth - 1, 0);
            GraphicConsole.Put('╚', 0, GraphicConsole.BufferHeight - 1);
            GraphicConsole.Put('╝', GraphicConsole.BufferWidth - 1, GraphicConsole.BufferHeight - 1);

            GraphicConsole.Draw.Line(1, 3, GraphicConsole.BufferWidth - 2, 3, '-');
            GraphicConsole.Draw.Line(1, 5, GraphicConsole.BufferWidth - 2, 5, '-');
            GraphicConsole.Draw.Line(1, 7, GraphicConsole.BufferWidth - 2, 7, '-');
            GraphicConsole.Draw.Line(1, 28, GraphicConsole.BufferWidth - 2, 28, '-');
        }
Exemplo n.º 9
0
        public override void DrawStep()
        {
            //Draw the star
            int r = 15;

            for (int i = 0; i < r; i++)
            {
                GraphicConsole.SetColor(GameManager.CurrentSystem.StarColor, Color4.Black);
                GraphicConsole.Draw.Circle(0, GraphicConsole.BufferHeight / 2, i, '.');
            }
            GraphicConsole.Draw.Circle(0, GraphicConsole.BufferHeight / 2, r, '*');

            //Draw the planets
            for (int i = 0; i < GameManager.CurrentSystem.Planetoids.Count; i++)
            {
                int x = i % 4;
                int y = i / 4;

                Planetoid planet = GameManager.CurrentSystem.Planetoids[i];

                int planetRadius = 5;

                GraphicConsole.SetColor(Color4.White, Color4.Black);
                GraphicConsole.Draw.Circle(x * 20 + 25, y * 15 + 10, planetRadius, '.');

                for (int moon = 0; moon < planet.Moons.Count; moon++)
                {
                    double angle = OpenTK.MathHelper.DegreesToRadians(moon * 30) - OpenTK.MathHelper.DegreesToRadians(90.0);
                    int    mX    = (int)(Math.Cos(angle) * (planetRadius + 3.1)) + (x * 20 + 25);
                    int    mY    = (int)(Math.Sin(angle) * (planetRadius + 1)) + (y * 15 + 10);

                    GraphicConsole.SetColor(Color4.White, Color4.Black);
                    GraphicConsole.Put('*', mX, mY);
                }
            }

            GraphicConsole.ClearColor();
            base.DrawStep();
        }