Example #1
0
        void GenerateRoad()
        {
            var param = new RoadParameter
            {
                NumberOfChunk     = parameter.numberOfChunk,
                ChunkSize         = parameter.chunkSize,
                Width             = maxRoadWidth,
                DistanceFromRiver = parameter.distanceFromRiver,
                Spacing           = parameter.roadSpacing,
            };

            road.Generate(param, river, random);
            fieldPoints.AddRange(road.Points);
        }
        public void Generate(RoadParameter parameter, RiverGenerator river, System.Random random)
        {
            lastInterruptionTime = System.DateTime.Now;
            this.parameter       = parameter;
            this.random          = random;
            this.river           = river;

            thinningDistance = (parameter.Spacing + parameter.Width) * 0.5f;

            points.Clear();
            pointMap.Clear();

            GenerateDistrictRoad();
            GenerateRoadAlongRiver(river.RootPoint);
            GenerateGridRoad();
        }