public void Render(SKCanvas canvas, MapDataContext mapDataContext)
        {
            using (var paint = new SKPaint())
            {
                paint.Style       = SKPaintStyle.Stroke;
                paint.Color       = new SKColor(0xB0, 0xB0, 0xFF, 0x1E);
                paint.IsAntialias = true;
                foreach (var solarSystemJump in mapDataContext.SolarSystemJumps)
                {
                    var fromSolarSystem = mapDataContext.SolarSystems.First(x => x.solarSystemID == solarSystemJump.fromSolarSystemID);
                    var toSolarSystem   = mapDataContext.SolarSystems.First(x => x.solarSystemID == solarSystemJump.toSolarSystemID);

                    if (solarSystemJump.IsRegionalJump)
                    {
                        paint.Color = SKColors.LightPink.WithAlpha(0x1E);
                    }
                    else if (solarSystemJump.IsConstellationJump)
                    {
                        paint.Color = SKColors.Red.WithAlpha(0x1E);
                    }
                    else
                    {
                        paint.Color = SKColors.Blue.WithAlpha(0x1E);
                    }


                    canvas.DrawLine(MapRenderUtils.EveCartesianToScreenPoint(fromSolarSystem.x, fromSolarSystem.z), MapRenderUtils.EveCartesianToScreenPoint(toSolarSystem.x, toSolarSystem.z), paint);
                }
            }
        }
        public void Render(SKCanvas canvas, MapDataContext mapDataContext)
        {
            using (var paint = new SKPaint())
            {
                paint.Style       = SKPaintStyle.StrokeAndFill;
                paint.IsAntialias = true;

                foreach (var solarSystem in mapDataContext.SolarSystems)
                {
                    if (solarSystem.allianceID != null && solarSystem.allianceID != 0)
                    {
                        var md5  = MD5.Create();
                        var hash = md5.ComputeHash(Encoding.UTF8.GetBytes(solarSystem.allianceID.ToString()));
                        paint.Color = new SKColor(hash[0], hash[1], hash[2]);
                        canvas.DrawOval(MapRenderUtils.EveCartesianToScreenPoint(solarSystem.x, solarSystem.z), new SKSize(2.0f, 1.0f), paint);
                    }
                    else
                    {
                        paint.Color = new SKColor(0xB0, 0xB0, 0xFF);
                        canvas.DrawOval(MapRenderUtils.EveCartesianToScreenPoint(solarSystem.x, solarSystem.z), new SKSize(1.0f, 0.5f), paint);
                    }

                    // paint.Color = new SKColor(randomBytes[0], randomBytes[1], randomBytes[2]);
                }
                canvas.DrawLine(new SKPoint(0.0f, 0.0f), new SKPoint(100.0f, 100.0f), paint);
            }
        }
Exemple #3
0
 public void Render(SKCanvas canvas, MapDataContext mapDataContext)
 {
     using (var paint = new SKPaint())
     {
         paint.Style       = SKPaintStyle.StrokeAndFill;
         paint.Color       = SKColors.White.WithAlpha(0x7E);
         paint.IsAntialias = true;
         paint.TextSize    = 12.0f;
         foreach (var region in mapDataContext.Regions)
         {
             canvas.DrawText(region.regionName, MapRenderUtils.EveCartesianToScreenPoint(region.x, region.z), paint);
         }
     }
 }
 public SolarSystemVertex(SolarSystem solarSystem)
 {
     SolarSystem = solarSystem;
     Point       = MapRenderUtils.EveCartesianToScreenPoint(solarSystem.x, solarSystem.z);
     Position    = new double[] { Point.X, Point.Y };
 }