Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.76 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using System.Drawing;
  3. using System.Runtime.Serialization;
  4.  
  5. namespace GlobalMap
  6. {
  7.     [KnownType(typeof(DefaultEarthAltitude))]
  8.     [KnownType(typeof(DryLandAltitude))]
  9.     [DataContract]
  10.     public abstract class AltitudeGenerationSettings
  11.     {
  12.         [DataMember(EmitDefaultValue = false)] public abstract Dictionary<(double level, string name), Color> Layers { get; set;}
  13.         public Color RiverColor => Color.FromArgb(byte.MaxValue,10,150,255);
  14.         public Color LakeColor => Color.FromArgb(byte.MaxValue,0,200,191);
  15.         [DataMember(EmitDefaultValue = false)] public abstract double SeaAltitude { get; set; }
  16.         [DataMember(EmitDefaultValue = false)] public abstract double LakeRelativeSquareThreshold { get; set; }
  17.         [DataMember(EmitDefaultValue = false)] public abstract double HeightWindBlockingThreshold { get; set; }
  18.     }
  19.  
  20.     [DataContract]
  21.     public class DefaultEarthAltitude : AltitudeGenerationSettings
  22.     {
  23.         public DefaultEarthAltitude()
  24.         {
  25.             Layers = new Dictionary<(double level, string name), Color>
  26.             {
  27.                 {(0, "Глубокая вода"), Color.FromArgb(byte.MaxValue,0, 0, 128)},
  28.                 {(0.4, "Вода"), Color.FromArgb(byte.MaxValue,32, 64, 128)},
  29.                 {(0.45, "Мелкая вода"), Color.FromArgb(byte.MaxValue,64, 96, 128)},
  30.                 {(0.455, "Береговая линия"), Color.FromArgb(byte.MaxValue,192, 192, 128)},
  31.                 {(0.55, "Прибрежная зона"), Color.FromArgb(byte.MaxValue,0, 192, 0)},
  32.                 {(0.625, "Равнина"), Color.FromArgb(byte.MaxValue,192, 192, 0)},
  33.                 {(0.76, "Предгорья"), Color.FromArgb(byte.MaxValue,160, 96, 64)},
  34.                 {(0.925, "Горы"), Color.FromArgb(byte.MaxValue,188, 180, 120)},
  35.                 {(0.9875, "Вершина мира"), Color.FromArgb(byte.MaxValue,byte.MaxValue, byte.MaxValue, byte.MaxValue)},
  36.             };
  37.             SeaAltitude = 0.455;
  38.             LakeRelativeSquareThreshold = 0.01;
  39.             HeightWindBlockingThreshold = 0.815;
  40.         }
  41.         public override Dictionary<(double level, string name), Color> Layers { get; set; }
  42.         public override double SeaAltitude { get; set; }
  43.         public override double LakeRelativeSquareThreshold {get; set;}
  44.         public override double HeightWindBlockingThreshold { get; set; }
  45.     }
  46.  
  47.     [DataContract]
  48.     public class DryLandAltitude : AltitudeGenerationSettings
  49.     {
  50.         public DryLandAltitude()
  51.         {
  52.             Layers = new Dictionary<(double level, string name), Color>
  53.             {
  54.                 {(0, "Вода"), Color.FromArgb(byte.MaxValue,32, 64, 128)},
  55.                 {(0.255, "Береговая линия"), Color.FromArgb(byte.MaxValue,192, 192, 128)},
  56.                 {(0.25, "Прибрежная зона"), Color.FromArgb(byte.MaxValue,0, 192, 0)},
  57.                 {(0.3, "Равнина"), Color.FromArgb(byte.MaxValue,192, 192, 0)},
  58.                 {(0.8, "Предгорья"), Color.FromArgb(byte.MaxValue,160, 96, 64)},
  59.                 {(0.9, "Горы"), Color.FromArgb(byte.MaxValue,128, 200, 200)},
  60.                 {(0.995, "Вершина мира"), Color.FromArgb(byte.MaxValue,byte.MaxValue, byte.MaxValue, byte.MaxValue)},
  61.             };
  62.             SeaAltitude = 0.255;
  63.             LakeRelativeSquareThreshold = 0.03;
  64.             HeightWindBlockingThreshold = 0.825;
  65.         }
  66.         public override Dictionary<(double level, string name), Color> Layers { get; set; }
  67.         public override double SeaAltitude { get; set; }
  68.         public override double LakeRelativeSquareThreshold {get; set;}
  69.         public override double HeightWindBlockingThreshold { get; set; }
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement