Example #1
0
    public HexRegion(int n, int seed, int region_size, int elevation, float water, int rivers, Noise noise)
    {
        this.n           = n;
        this.seed        = seed;
        this.region_size = region_size;
        this.center      = region_size / 2f;
        this.elevation   = elevation;
        this.noise       = noise;
        this.water       = water;

        RegionParams.InitializeWorldGenerationParams(this);

        CreateHexPositionVectors(this.n);

        computeElevationParameters();

        RegionParams.UpdateWorldGenerationParams(this);

        //computeErosion(RegionParams.erosionWaterAmount, RegionParams.erosionStrength, RegionParams.erosionWaterLoss,
        //                RegionParams.earthStability, RegionParams.erosionVelocityElevationCap, RegionParams.erosionIterations);

        computeElevationParameters();

        computeTemperatures();

        generateWaterTiles(this.water);

        Debug.Log("Generated Region with " + this.getViewableTiles().Count + "/" + this.n + " viewable tiles; hexsize " + this.hexSize + ", hexheight " + this.hexHeight +
                  ", water level elevation " + this.waterLevelElevation + "; min/avg/max elevations = " + this.minElevation + "/" + this.averageElevation + "/" + this.maxElevation);
    }
Example #2
0
            /// <summary>
            /// Initializes a new instance of the <see cref="NodeParams"/> class.
            /// </summary>
            public NodeParams(RegionParams parentRegionParams, Type type, string name)
            {
                this.ParentRegionParams = parentRegionParams;

                // If this region is child of an higher region in the hierarchy then updates the set of child regions of the latter
                if (this.ParentRegionParams != null)
                {
                    this.ParentRegionParams.Children.Add(this);
                }

                this.Type = type;
                this.Name = name;
            }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeParams"/> class.
 /// </summary>
 public RegionParams(RegionParams parentRegionParams, string name)
     : base(parentRegionParams, Type.Region, name)
 {
 }
Example #4
0
            /// <summary>
            /// Initializes a new instance of the <see cref="NodeParams"/> class.
            /// </summary>
            public NodeParams(RegionParams parentRegionParams, Type type, string name)
            {
                this.ParentRegionParams = parentRegionParams;

                // If this region is child of an higher region in the hierarchy then updates the set of child regions of the latter
                if (this.ParentRegionParams != null)
                {
                    this.ParentRegionParams.Children.Add(this);
                }

                this.Type = type;
                this.Name = name;
            }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeParams"/> class.
 /// </summary>
 public FileSensorParams(RegionParams parentRegionParams, string name)
     : base(parentRegionParams, Type.FileSensor, name)
 {
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeParams"/> class.
 /// </summary>
 public DatabaseSensorParams(RegionParams parentRegionParams, string name)
     : base(parentRegionParams, Type.DatabaseSensor, name)
 {
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeParams"/> class.
 /// </summary>
 public DatabaseSensorParams(RegionParams parentRegionParams, string name)
     : base(parentRegionParams, Type.DatabaseSensor, name)
 {
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeParams"/> class.
 /// </summary>
 public FileSensorParams(RegionParams parentRegionParams, string name)
     : base(parentRegionParams, Type.FileSensor, name)
 {
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeParams"/> class.
 /// </summary>
 public RegionParams(RegionParams parentRegionParams, string name)
     : base(parentRegionParams, Type.Region, name)
 {
 }