Example #1
0
    public static MapSettings HotseatSettings()
    {
        eMap              mapType         = eMap.Basic;
        eTileShape        tileShape       = eTileShape.Square;
        int               xDim            = 19;
        int               yDim            = 19;
        bool              wrapEastWest    = false;
        bool              wrapNorthSouth  = false;
        float             percentOcean    = 0.3f;
        float             percentRiver    = 0.01f;
        int               expansionFactor = 0;
        WaterBodyPrefence wbp             = WaterBodyPrefence.Continent;

        MapSettings settings = new MapSettings(mapType,
                                               tileShape,
                                               xDim,
                                               yDim,
                                               wrapEastWest,
                                               wrapNorthSouth,
                                               percentOcean,
                                               percentRiver,
                                               expansionFactor,
                                               wbp);

        return(settings);
    }
Example #2
0
 public MapSettings(MapConfigs configs)
 {
     _mapType         = configs._mapType;
     _tileShape       = configs._tileShape;
     _xDim            = configs.xDim;
     _yDim            = configs.yDim;
     _wrapEastWest    = configs.wrapEastWest;
     _wrapNorthSouth  = configs.wrapNorthSouth;
     _percentOcean    = configs.percentLand;
     _percentRiver    = configs.percentRiver;
     _expansionFactor = configs.expansionFactor;
     _waterBodyPref   = configs.waterBodyPref;
 }
Example #3
0
 public MapSettings(eMap mapType,
                    eTileShape tileShape,
                    int xDim,
                    int yDim,
                    bool wrapEastWest,
                    bool wrapNorthSouth,
                    float percentOcean,
                    float percentRiver,
                    int expansionFactor,
                    WaterBodyPrefence waterBodyPref)
 {
     _mapType         = mapType;
     _tileShape       = tileShape;
     _xDim            = xDim;
     _yDim            = yDim;
     _wrapEastWest    = wrapEastWest;
     _wrapNorthSouth  = wrapNorthSouth;
     _percentOcean    = percentOcean;
     _percentRiver    = percentRiver;
     _expansionFactor = expansionFactor;
     _waterBodyPref   = waterBodyPref;
 }
Example #4
0
    public static void TransformApplyPreferencesWaterBody(ref float[,] Elevation, float seaLevel, WaterBodyPrefence prefWaterBody, Benchmark bench = null)
    {
        if (!(bench == null))
        {
            bench.StartBenchmark("Water Bodies");
        }
        if (prefWaterBody == WaterBodyPrefence.Islands)
        {
            if (GetMapBorderAverage(Elevation) > 0.5f)
            {
                TransformMap(ref Elevation, dInvert, 0f);
            }
        }
        else if (prefWaterBody == WaterBodyPrefence.Continent)
        {
            AddMaskIsland(ref Elevation, 0.1f);
            if (GetMapBorderAverage(Elevation) > 0.5f)
            {
                TransformMap(ref Elevation, dInvert, 0f);
            }
        }
        else if (prefWaterBody == WaterBodyPrefence.Lakes)
        {
            if (GetMapBorderAverage(Elevation) < 0.5f)
            {
                TransformMap(ref Elevation, dInvert, 0f);
            }
        }
        else if (prefWaterBody == WaterBodyPrefence.Coast)
        {
            AddMaskCoast(ref Elevation);
            if (GetMapBorderAverage(Elevation) > 0.5f)
            {
                TransformMap(ref Elevation, dInvert, 0f);
            }
        }
        if (!(bench == null))
        {
            bench.EndBenchmark("Water Bodies");
        }

        TransformMapMinMax(ref Elevation, dNormalize);
        TransformEqualizeMapByLevel(ref seaLevel, ref Elevation, 0.5f, bench);
    }