public Point Project(EarthPoint p, int Zoom) { var surfacePoint = (SurfacePoint)p; double mpp = _scales[Zoom]; return(new Point(Math.Round(surfacePoint.X / mpp), Math.Round(-surfacePoint.Y / mpp))); }
static void Main(string[] args) { String CanRecordPath = args[0]; String TrackPath = args[1]; FrameSbsEncoder enc = new FrameSbsEncoder(); using (var fs = new FileStream(CanRecordPath, FileMode.Open)) { var Frames = enc.DecodeStream(fs); EarthPoint PrewPoint = null; foreach (var f in Frames) { switch (f.Descriptor) { case Dsc_MM_ALT_LONG: var mmll = BlokFrame.GetBlokFrame <MmAltLongFrame>(f); //var ThisPoint = new EarthPoint(); break; } } } }
public GPost Read(Stream MapStream, int SectionId) { var postData = ReadBytes(MapStream, _recordLength); var ordinate = BitConverter.ToInt32(postData.Take(3).Concat(new byte[1]).ToArray(), 0); var flags = postData[3]; var direction = DecodeDirection((flags >> 7) & 0x01); var position = (PositionInSection)(flags & 0x03); var crossing = (flags & (1 << 6)) > 0; var point = new EarthPoint(BitConverter.ToInt32(postData, 4) * 10e-9 * 180 / Math.PI, BitConverter.ToInt32(postData, 8) * 10e-9 * 180 / Math.PI); var childrenStartAddress = SubInt(postData, 12, 3); var post = new GPost(ordinate, point, direction, position, SectionId, crossing); var previousPosition = MapStream.Position; MapStream.Seek(childrenStartAddress, SeekOrigin.Begin); var tracksCount = MapStream.ReadByte(); for (var i = 0; i < tracksCount; i++) { var track = _trackReader.Read(MapStream); if (track != null) { post.Tracks.Add(track); } } MapStream.Seek(previousPosition, SeekOrigin.Begin); return(post); }
private static IEnumerable <PositionedGObject> PositeObjects(GSection sec, GPost post) { GPost p2 = sec.Posts .Where(pp => (int)post.Direction * (post.Ordinate - pp.Ordinate) > 0) .OrderBy(pp => (int)post.Direction * (post.Ordinate - pp.Ordinate)).FirstOrDefault(); if (p2 == null) { yield break; } double l = post.Point.DistanceTo(p2.Point); foreach (var o in post.Tracks.First().Objects) { double ratio = (o.Ordinate - post.Ordinate) / l; var o_point = new EarthPoint( (1 - ratio) * post.Point.Latitude + ratio * p2.Point.Latitude, (1 - ratio) * post.Point.Longitude + ratio * p2.Point.Longitude); yield return(new PositionedGObject() { Object = o, Point = o_point }); } }
public void CreateMountains() { //first check for ocean subduction plates foreach (EarthPoint ep in Points.Values.Where(p => p.collision && p.height == 5)) { RaiseGround(ep.pos, true); } //old mountains for (int i = 0; i < 15; i++) { List <EarthPoint> landPoints = Points.Values.Where(p => p.height == 5).ToList(); EarthPoint start = landPoints[Random.Range(0, landPoints.Count)]; Vector2 genDirection = new Vector2(Random.Range(-1, 2), Random.Range(-1, 2)); if (genDirection == Vector2.zero) { genDirection = Vector2.one; } Vector2 lastPos = start.pos; for (int m = 0; m < Random.Range(5, 15); m++) { Vector2 newpos = GetWorldMapPos(lastPos + genDirection + new Vector2(Random.Range(-1, 2), Random.Range(-1, 2))); if (lastPos == newpos) { continue; } if (Points.ContainsKey(newpos) && Points[newpos].land) { RaiseGround(newpos); } lastPos = newpos; } } //hotspots for (int i = 0; i < 50; i++) { List <EarthPoint> landPoints = Points.Values.Where(p => p.land).ToList(); EarthPoint start = landPoints[Random.Range(0, landPoints.Count)]; Vector2 genDirection = new Vector2(Random.Range(-1, 2), Random.Range(-1, 2)); if (genDirection == Vector2.zero) { genDirection = Vector2.one; } Vector2 lastPos = start.pos; for (int m = 0; m < Random.Range(1, 4); m++) { Vector2 newpos = GetWorldMapPos(lastPos + genDirection + new Vector2(Random.Range(-1, 2), Random.Range(-1, 2))); if (lastPos == newpos) { continue; } if (Points.ContainsKey(newpos) && Points[newpos].land) { RaiseGround(newpos, true, false, 2); } lastPos = newpos; } } }
protected override void Draw(DrawingContext dc, int RenderZoom) { EarthPoint topLeftPoint = OsmIndexes.GetTopLeftPoint(HorizontalIndex, VerticalIndex, RenderZoom); Point topLeftPointScreenProjection = Projector.Project(topLeftPoint, RenderZoom); var tileRect = new Rect(topLeftPointScreenProjection, new Size(256, 256)); DrawTile(dc, tileRect); }
public void OceanDepth() { //can expand later for better looking ocean, for now just for showing tectonic plates foreach (Plate p in Plates) { foreach (Plate p2 in p.NeighboringPlates) { float dist = Vector2.Distance(p2.center, p.center); float modDist = Vector2.Distance(p2.center + p2.direction.normalized, p.center + p.direction.normalized); float newDist = modDist - dist; if (newDist > 0.75)//atlantic drift apart, vector pointing away { foreach (Vector2 v in p.Points) { EarthPoint ep = Points[v]; if (!ep.land) { List <EarthPoint> neighbors = Neighbors(v, false, 5); /*foreach (EarthPoint point in neighbors) * { * if (point.land) * continue; * if (Mathf.Abs(point.pos.x - v.x) == 5 || Mathf.Abs(point.pos.y - v.y) == 5) * point.height = 0; * if (Mathf.Abs(point.pos.x - v.x) == 4 || Mathf.Abs(point.pos.y - v.y) == 4 && point.height == 0) * point.height = 1; * if (Mathf.Abs(point.pos.x - v.x) == 3 || Mathf.Abs(point.pos.y - v.y) == 3 && point.height == 0) * point.height = 2; * if (Mathf.Abs(point.pos.x - v.x) == 2 || Mathf.Abs(point.pos.y - v.y) == 2 && point.height == 0) * point.height = 3; * if (Mathf.Abs(point.pos.x - v.x) == 1 || Mathf.Abs(point.pos.y - v.y) == 1 && point.height == 0) * point.height = 4; * }*/ if (ep.collisionPlateNumber == p2.plateNumber && !ep.land) { ep.height = 3; } } } } else { foreach (Vector2 v in p.Points) { EarthPoint ep = Points[v]; if (ep.collisionPlateNumber == p2.plateNumber && !ep.land) { if (ep.height == 0) { ep.height = 4; } } } } } } }
public GPost(int Ordinate, EarthPoint Point, OrdinateDirection Direction, PositionInSection Position, int SectionId, bool Crossing) { this.Ordinate = Ordinate; this.Point = Point; this.Direction = Direction; this.Position = Position; this.SectionId = SectionId; this.Crossing = Crossing; Tracks = new List <GTrack>(); }
static void Main(string[] args) { var p1 = new EarthPoint(77.1539, -139.398); var p2 = new EarthPoint(-77.1804, -139.55); var r = p1.DistanceTo(p2); String GpxPath = args[0]; String TxtPath = args[1]; var gpx = XDocument.Load(GpxPath).Root; var EarthPoints = gpx.Element("trk").Element("trkseg") .Elements("trkpt") .Select(XPoint => new EarthPoint((Double)XPoint.Attribute("lat"), (Double)XPoint.Attribute("lon"))) .ToList(); using (TextWriter tw = new StreamWriter(TxtPath)) { EarthPoint prewPoint = null; double x = 0; foreach (var p in EarthPoints) { if (prewPoint != null) { x += p.DistanceTo(prewPoint); } prewPoint = p; var s = string.Format(System.Globalization.CultureInfo.InvariantCulture.NumberFormat, "{{ {0:F6}, {1:F6}, {2:F0} }},", p.Latitude, p.Longitude, x); tw.WriteLine(s); Console.WriteLine(s); } } Console.ReadLine(); }
public void CreateTectonics() { int count = 0; for (int i = 0; i < 10; i++) { Vector2 voronoi = new Vector2(Random.Range(0, worldWidth), Random.Range(0, worldHeight)); Plates.Add(new Plate(i, voronoi, false)); } foreach (EarthPoint ep in Points.Values) { float shortestDist = 999999; Plate selectedPlate = null; float amp = 1; float freq = 1; float noiseHeight = 0; for (int i = 0; i < octaves; i++) { var per = Mathf.PerlinNoise((ep.pos.x + 60) / 50f / zoom * freq, (ep.pos.y + 60) / 50f / zoom * freq) * 2.5f - 1; noiseHeight += per * amp; amp *= pers; freq *= lac; } if (noiseHeight > 1) { noiseHeight = 1; } if (noiseHeight < 0) { noiseHeight = 0; } noiseHeight *= multi + 5; foreach (Plate plate in Plates) { Vector2 voronCenter = plate.center; float xDist1 = Mathf.Abs(voronCenter.x - ep.pos.x) + noiseHeight; float xDist2 = Mathf.Abs(voronCenter.x + worldWidth - ep.pos.x) + noiseHeight; float xDist3 = Mathf.Abs(voronCenter.x - worldWidth - ep.pos.x) + noiseHeight; float xDist = Mathf.Min(xDist1, xDist2, xDist3); float yDist = voronCenter.y - ep.pos.y;// + noiseHeight; float dist = Mathf.Sqrt(Mathf.Pow(xDist, 2) + Mathf.Pow(yDist, 2)); if (dist < shortestDist) { shortestDist = dist; selectedPlate = plate; } } ep.plateNumber = selectedPlate.plateNumber; selectedPlate.Points.Add(ep.pos); } //can add oceanic plates to prevent continents from spawning there //Plates.OrderByDescending(p => p.Points.Count).ToList()[0].oceanic = true; //Plates.OrderByDescending(p => p.Points.Count).ToList()[1].oceanic = true; foreach (var pair in Points) { int tecNumber = pair.Value.plateNumber; Plate pointPlate = Plates.First(p => p.plateNumber == tecNumber); List <EarthPoint> neighbors = Neighbors(pair.Key); if (neighbors.Any(p => p.plateNumber != tecNumber)) { EarthPoint collisionNeighbor = neighbors.First(p => p.plateNumber != tecNumber); Plate collisionPlate = Plates.First(p => p.plateNumber == collisionNeighbor.plateNumber); pair.Value.collisionPlateNumber = collisionNeighbor.plateNumber; if (!pointPlate.NeighboringPlates.Contains(collisionPlate)) { pointPlate.NeighboringPlates.Add(collisionPlate); } } } }
public void CreateIslands() { //subduction islands foreach (Plate p in Plates) { foreach (Plate p2 in p.NeighboringPlates) { float dist = Vector2.Distance(p2.center, p.center); float modDist = Vector2.Distance(p2.center + p2.direction.normalized, p.center + p.direction.normalized); float newDist = modDist - dist; if (newDist < -0.75)//distance with movement vectors is shorter, they are coming together { //create islands on this border foreach (Vector2 v in p2.Points) { EarthPoint ep = Points[v]; if (ep.collisionPlateNumber == p.plateNumber) { List <EarthPoint> neighbors = Neighbors(v, true); //nicer water foreach (EarthPoint neighbor in neighbors.Where(p => p.plateNumber == p2.plateNumber && !ep.land)) { if (Random.Range(0, 20) == 0) { neighbor.height = 4; } } //5% chance to make islands if (Random.Range(0, 15) == 0) { foreach (EarthPoint neighbor in neighbors.Where(p => p.plateNumber == p2.plateNumber && !ep.land)) { if (Random.Range(0, 2) == 0) { neighbor.height = Random.Range(5, 8); neighbor.island = true; } } } } } //visual subduction on our side foreach (Vector2 v in p.Points) { EarthPoint ep = Points[v]; if (ep.collisionPlateNumber == p2.plateNumber && !ep.land) { ep.height = 2; } } } } } //hotspot islands for (int i = 0; i < 15; i++) { List <EarthPoint> oceanPoints = Points.Values.Where(p => !p.land).ToList(); EarthPoint start = oceanPoints[Random.Range(0, oceanPoints.Count)]; Vector2 genDirection = new Vector2(Random.Range(-1, 2), Random.Range(-1, 2)); if (genDirection == Vector2.zero) { genDirection = Vector2.one; } Vector2 lastPos = start.pos; for (int m = 0; m < Random.Range(1, 4); m++) { Vector2 newpos = GetWorldMapPos(lastPos + genDirection + new Vector2(Random.Range(-1, 2), Random.Range(-1, 2))); if (lastPos == newpos) { continue; } if (Points.ContainsKey(newpos) && !Points[newpos].land) { RaiseGround(newpos, false, true); } lastPos = newpos; } } }
public MapPlatformElement(EarthPoint Position, GObject Target) : base(Position, Target) { }
/// <summary> /// This is a console example of importing zones of a specified type from a shape file set (.shp, .shx, .dbf) or csv file into a specified database. /// Included in this project is are sample shape files: owensboro /// /// 1) Process command line arguments: Server, Database, User name, Password, Options and load the specified shape/csv file set. /// 2) Process the shapes present in the shape file, using the Geotab.Geographical components to create zones from the shape points and names. /// 3) Create Geotab API object and Authenticate. /// 4) Import created zones into the database. /// The format of csv file is next: /// [Zone_name] /// [polygon_point_x], [polygon_point_y] /// [polygon_point_x], [polygon_point_y] /// . /// . /// [polygon_point_x], [polygon_point_y] /// [Zone_name] /// [polygon_point_x], [polygon_point_y] /// . /// . /// A complete Geotab API object and method reference is available at the Geotab Developer page. /// </summary> /// <param name="args">The command line arguments for the application. Note: When debugging these can be added by: Right click the project > Properties > Debug Tab > Start Options: Command line arguments.</param> static void Main(string[] args) { try { if (args.Length < 5) { Console.WriteLine(); Console.WriteLine("Command line parameters:"); Console.WriteLine("dotnet run <server> <database> <login> <password> [--nameAttr=<attr>] [--namePrefix=<prefix>] [--type=<name>] <inputfile>"); Console.WriteLine(); Console.WriteLine("Command line: dotnet run server database username password --nameAttr=name --namePrefix=CA --type=home inputfile.shp"); Console.WriteLine("server - The server name (Example: my.geotab.com)"); Console.WriteLine("database - The database name (Example: G560)"); Console.WriteLine("username - The Geotab user name"); Console.WriteLine("password - The Geotab password"); Console.WriteLine("[--nameAttr=<attr>] - Optional - Name of the shape's attribute to use as"); Console.WriteLine(" the zone name. (Default: first attribute containing"); Console.WriteLine(" the word 'name')"); Console.WriteLine("[--namePrefix=<prefix>] - Optional - The name prefix. (Example: prefix + Name)"); Console.WriteLine("[--type=<name>] - Optional - Specify zone type (Default: customer)"); Console.WriteLine("[--threshold=<number>] - Optional - Simplify zones by removing redundant"); Console.WriteLine(" points. Any point within approximately <threshold>"); Console.WriteLine(" meters of a line connecting its neighbors will be"); Console.WriteLine(" removed."); Console.WriteLine("inputfile - File name of the Shape file containing the shapes to"); Console.WriteLine(" import with extension. (.shp, .shx, .dbf)"); Console.WriteLine(); return; } // Variables from command line int last = args.Length - 1; string server = args[0]; string database = args[1]; string username = args[2]; string password = args[3]; List <ZoneType> zoneTypes = new List <ZoneType>(); string fileName = args[last]; string nameAttribute = null; string prefix = ""; double distanceSquaredError = -1; Color zonesColour = customerZoneColor; // Create Geotab API object API api = new API(username, password, null, database, server); // Authenticate Console.WriteLine("Authenticating..."); api.Authenticate(); Console.WriteLine("Getting current user..."); List <User> users = api.Call <List <User> >("Get", typeof(User), new { search = new UserSearch { Name = api.UserName } }); if (users.Count != 1) { Console.WriteLine($"Found {users.Count} users with name {api.UserName}."); return; } // the user's groups will be used when creating the zones var groups = users[0].CompanyGroups; Console.WriteLine("Getting available zone types..."); List <ZoneType> availableZoneTypes = api.Call <List <ZoneType> >("Get", typeof(ZoneType)); // Options from args for (int i = 4; i < last; i++) { string option = args[i].ToLowerInvariant(); int index = option.IndexOf('='); // Check the option is in the established format if (index >= 0 && option.Length > index + 1) { // Grab the value of the optional argument string value = option.Substring(index + 1).ToLowerInvariant(); // Zone type option if (option.Contains("type")) { ZoneType zoneType = GetZoneType(value, availableZoneTypes); if (zoneType != null && !zoneTypes.Contains(zoneType)) { // Setting a default colour switch (zoneType.Name) { case "**Customer Zone": zonesColour = customerZoneColor; break; case "**Home Zone": zonesColour = homeZoneColor; break; case "**Office Zone": zonesColour = officeZoneColor; break; } zoneTypes.Add(zoneType); } } // Name attribute option else if (option.Contains("nameattr")) { nameAttribute = value; } // Name prefix option else if (option.Contains("prefix")) { prefix = value.ToUpperInvariant(); } // Zone shape simplification threshold option else if (option.Contains("threshold")) { if (!double.TryParse(value, out double threshold)) { Console.WriteLine("Threshold must be a number. Example: 2.5"); } else { distanceSquaredError = Math.Pow(1e-5 * threshold, 2); } } else { Console.WriteLine($"Unknown optional argument: {option}"); } } else { Console.WriteLine($"Unknown format for optional argument: {option}"); } } // Use Customer Zone Type for default. if (zoneTypes.Count < 1) { zoneTypes.Add(ZoneTypeCustomer.Value); } IList <ISimpleCoordinate> coordinates = new List <ISimpleCoordinate>(); IList <Zone> zones = new List <Zone>(); // Initialize variables to hold the shape file DateTime maxValue = System.TimeZoneInfo.ConvertTimeToUtc(DateTime.MaxValue); DateTime minValue = DateTime.MinValue; if (!string.IsNullOrEmpty(fileName) && Path.GetExtension(fileName).ToLower().Contains("csv")) { if (!File.Exists(fileName)) { Console.WriteLine($"The file {fileName} does not exist."); return; } Console.WriteLine("Loading csv file..."); using (StreamReader reader = File.OpenText(fileName)) { string line; string zoneName = string.Empty; while (!string.IsNullOrEmpty(line = reader.ReadLine())) { string[] values = line.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (values.Length == 0 || values.Length == 1 && string.IsNullOrWhiteSpace(values[0])) { continue; } switch (values.Length) { case 1: if (!string.IsNullOrEmpty(values[0])) { if (!string.IsNullOrEmpty(zoneName)) { // Simplify the zone shape. This is an important step. Polygon complexity can drastically impact performance when loading/rendering zones. coordinates = SimplifyPolygon(coordinates, distanceSquaredError); // Create the zone object to be inserted later on zones.Add(new Zone(null, (string.IsNullOrEmpty(prefix) ? "" : prefix + " ") + zoneName, "", true, zoneTypes, coordinates, minValue, maxValue, zonesColour, true, groups)); } coordinates = new List <ISimpleCoordinate>(); zoneName = values[0]; } break; case 2: // read coordinates line by line if (double.TryParse(values[0], out var xCoord) && double.TryParse(values[1], out var yCoord)) { coordinates.Add(new Coordinate(xCoord, yCoord)); } break; default: Console.WriteLine($"Skipping a line with text '{line}'"); break; } } if (!string.IsNullOrEmpty(zoneName)) { coordinates = SimplifyPolygon(coordinates, distanceSquaredError); zones.Add(new Zone(null, (string.IsNullOrEmpty(prefix) ? "" : prefix + " ") + zoneName, "", true, zoneTypes, coordinates, minValue, maxValue, zonesColour, true, groups)); } } } else { FileInfo shapeFile = new FileInfo(fileName); FileMapLayerFactory factory = new FileMapLayerFactory(shapeFile); ShapeFileLayer layer; // Try to load the shape file Console.WriteLine("Loading shape file..."); try { layer = (ShapeFileLayer)factory.GetMapLayer(); } catch (Exception exception) { Console.WriteLine($"Could not load shape file: {exception.Message}"); return; } // Get the index of the feature attribute that holds the zone name Console.WriteLine("__ " + nameAttribute); int nameAttributeIndex = GetNameAttributeIndex(layer, ref nameAttribute); if (nameAttributeIndex == -1) { Console.WriteLine("Could not find a valid attribute to use for naming the zones."); return; } // Process shapes into zones int featureIndex = 0; for (int k = 0; k < layer.Features.Count; k++) { IEarthFeature earthFeature = layer.Features[k]; // Get the data we are interested in for the zone IEarthPolygon polygon = earthFeature as IEarthPolygon; string zoneName = layer.GetFeatureField(featureIndex, nameAttributeIndex).ToString(); // Filter out non-polygons and unnamed shapes if (polygon == null || string.IsNullOrEmpty(zoneName)) { featureIndex++; continue; } // Get the points that define the polygon coordinates = new List <ISimpleCoordinate>(); for (int i = 0; i < polygon.Count; i++) { EarthPoint earthPoint = (EarthPoint)polygon[i]; ISimpleCoordinate coordinate = new Coordinate(earthPoint.X, earthPoint.Y); coordinates.Add(coordinate); } // Simplify the polygon. This is an important step. Polygon complexity can drastically impact performance when loading/rendering zones. coordinates = SimplifyPolygon(coordinates, distanceSquaredError); zones.Add(new Zone(null, (string.IsNullOrEmpty(prefix) ? "" : prefix + " ") + zoneName, "", true, zoneTypes, coordinates, minValue, maxValue, zonesColour, true, groups)); featureIndex++; } } Console.WriteLine($"Found {zones.Count} zones to import"); if (zones.Count < 1) { return; } // Start import Console.WriteLine("Importing zones..."); foreach (Zone zone in zones) { try { // Add the zone api.Call <Id>("Add", typeof(Zone), new { entity = zone }); Console.WriteLine($"Zone: '{zone.Name}' added"); } catch (Exception exception) { // Catch and display any error that occur when adding the zone Console.WriteLine($"Error adding zone: '{zone.Name}'\n{exception.Message}"); } } } catch (Exception ex) { // Show miscellaneous exceptions Console.WriteLine($"Error: {ex.Message}\n{ex.StackTrace}"); } finally { Console.WriteLine("Press any key to continue..."); Console.ReadKey(true); } }
public MapTrafficLightElement(EarthPoint Position, GObject Target) : base(Position, Target) { }
protected MapPointElement(EarthPoint Position) { _position = Position; }
public MapUnknownObjectElement(EarthPoint Position, GObject Target) : base(Position, Target) { }
public MapObjectElement(EarthPoint Position, GObject Target) : base(Position) { this.Target = Target; }
void Start() { //UGLY colors.Add(new Color(22f / 255f, 81f / 255f, 1)); colors.Add(new Color(18f / 255f, 95f / 255f, 1)); colors.Add(new Color(14f / 255f, 105f / 255f, 1)); colors.Add(new Color(14f / 255f, 115f / 255f, 1)); colors.Add(new Color(18f / 255f, 128f / 255f, 1)); colors.Add(new Color32(61, 42, 0, 255)); colors.Add(new Color32(61, 42, 0, 255)); colors.Add(new Color32(61, 42, 0, 255)); colors.Add(new Color32(61, 42, 0, 255)); colors.Add(new Color32(61, 42, 0, 255)); //UGLY! just setting colors for climate zones and the world map ClimateColors.Add(Climate.TropicalRainforest.ToString(), new Color32(36, 3, 221, 255)); ClimateColors.Add(Climate.TropicalSavannah.ToString(), new Color32(71, 170, 250, 255)); ClimateColors.Add(Climate.TropicalMonsoon.ToString(), new Color32(1, 104, 255, 255)); ClimateColors.Add(Climate.Desert.ToString(), Color.red); ClimateColors.Add(Climate.HotSteppe.ToString(), new Color32(244, 164, 7, 255)); ClimateColors.Add(Climate.HumidContinental.ToString(), new Color32(0, 255, 255, 255)); ClimateColors.Add(Climate.SubarcticContinental.ToString(), new Color32(0, 126, 200, 255)); ClimateColors.Add(Climate.Mediterranean.ToString(), new Color32(255, 255, 0, 255)); ClimateColors.Add(Climate.HumidSubtropical.ToString(), new Color32(149, 255, 148, 255)); ClimateColors.Add(Climate.Oceanic.ToString(), Color.green); ClimateColors.Add(Climate.ColdDesert.ToString(), new Color32(255, 150, 150, 255)); ClimateColors.Add(Climate.ColdSteppe.ToString(), new Color32(255, 220, 100, 255)); ClimateColors.Add(Climate.Tundra.ToString(), Color.grey); ClimateColors.Add(Climate.IceCap.ToString(), Color.white); ClimateColors.Add(Climate.Grassland.ToString(), Color.black); GeographicClimateColors.Add(Climate.TropicalRainforest.ToString(), new Color32(28, 46, 20, 255)); GeographicClimateColors.Add(Climate.TropicalSavannah.ToString(), new Color32(85, 115, 23, 255)); GeographicClimateColors.Add(Climate.TropicalMonsoon.ToString(), new Color32(99, 132, 63, 255)); GeographicClimateColors.Add(Climate.Desert.ToString(), new Color32(250, 230, 157, 255)); GeographicClimateColors.Add(Climate.HotSteppe.ToString(), new Color32(212, 174, 127, 255)); GeographicClimateColors.Add(Climate.HumidContinental.ToString(), new Color32(49, 76, 35, 255)); GeographicClimateColors.Add(Climate.SubarcticContinental.ToString(), new Color32(35, 49, 24, 255)); GeographicClimateColors.Add(Climate.Mediterranean.ToString(), new Color32(86, 83, 40, 255)); GeographicClimateColors.Add(Climate.HumidSubtropical.ToString(), new Color32(32, 61, 17, 255)); GeographicClimateColors.Add(Climate.Oceanic.ToString(), new Color32(53, 92, 39, 255)); GeographicClimateColors.Add(Climate.ColdDesert.ToString(), new Color32(196, 174, 127, 255)); GeographicClimateColors.Add(Climate.ColdSteppe.ToString(), new Color32(126, 114, 76, 255)); GeographicClimateColors.Add(Climate.Tundra.ToString(), new Color32(88, 83, 51, 255)); GeographicClimateColors.Add(Climate.IceCap.ToString(), Color.white); GeographicClimateColors.Add(Climate.Grassland.ToString(), Color.black); //create the points that hold data, everything on an INT level between 0 -> width for x, 0 -> height for y for (int x = 0; x < worldWidth; x++) { for (int y = 0; y < worldHeight; y++) { EarthPoint ep = new EarthPoint(new Vector2(x, y)); Points.Add(new Vector2(x, y), ep); } } CreateTectonics(); DeterminePlateDirection(); CreateContinents(); CreateMountains(); OceanDepth(); CreateIslands(); CalcWindDirection(); CalcOceanDirection(); CalcPrecipitation(); CalcClimate(); ColorWorld(); }