public NewBaseLocation(MapLocation location) { this.location = location; AddControl(new Border(64, 16, 224, 72, ColorScheme.Green, Backgrounds.Title, 0)); AddControl(new Label(80, 68, "Cost>$", Font.Normal, ColorScheme.Green)); AddControl(new Label(90, 68, "Area>", Font.Normal, ColorScheme.Green)); AddControl(new Label(80, 97, location.RegionType.Metadata().BaseCost.FormatNumber(), Font.Normal, ColorScheme.Yellow)); AddControl(new Label(90, 92, location.RegionType.Metadata().Name, Font.Normal, ColorScheme.Yellow)); AddControl(new Button(104, 68, 50, 12, "OK", ColorScheme.Green, Font.Normal, OnOk)); AddControl(new Button(104, 138, 50, 12, "CANCEL", ColorScheme.Green, Font.Normal, EndModal)); }
public Map() { var index = 0; var data = WorldResources.Map; foreach (var longitude in Enumerable.Range(0, longitudeCount)) { foreach (var latitudeIndex in Enumerable.Range(0, latitudeCount)) { var terrain = data[index++]; var region = data[index++]; locations[longitude, latitudeIndex] = new MapLocation { Location = new Location { Longitude = longitude, Latitude = latitudeIndex + minLatitude }, TerrainType = terrain == byte.MaxValue ? null : (TerrainType?)terrain, RegionType = (RegionType)region }; } } }