Example #1
0
        //Lake only


        //Chasm only

        /// <summary>
        /// Constructor to initalize NaturalFeature as a River.
        /// </summary>
        /// <param name="river_start"></param>
        /// <param name="river_end"></param>
        /// <param name="deep_thick"></param>
        /// <param name="shallow_thick"></param>
        /// <param name="bank_thick"></param>
        public NaturalFeature(gridCoordinate river_start, gridCoordinate river_end, int deep_thick,
                              int shallow_thick, int bank_thick)
        {
            river_startCoord    = river_start;
            river_endCoord      = river_end;
            deepwater_thickness = deep_thick;
            shallow_thickness   = shallow_thick;
            banks_thickness     = bank_thick;
            my_fType            = Feature_Type.River;
        }
        /// <summary>
        /// Constructor to initalize NaturalFeature as a River.
        /// </summary>
        /// <param name="river_start">The gridcoordinate that the river starts on</param>
        /// <param name="river_end">The gridcoordinate that the river ends on</param>
        /// <param name="deep_thick">The deep water thickness is 1 + up to this #</param>
        /// <param name="shallow_thick">Shallow water thickness is 1 + up to this #</param>
        /// <param name="bank_thick">Shoreline thickness is 1 + up to this #</param>
        public NaturalFeature(gridCoordinate river_start, gridCoordinate river_end, River_Type r_typ,
                              int deep_thick, int shallow_thick, int bank_thick)
        {
            feature_startCoord = river_start;
            feature_endCoord = river_end;
            deepwater_thickness = deep_thick;
            shallow_thickness = shallow_thick;
            banks_thickness = bank_thick;
            my_fType = Feature_Type.River;
            my_rivType = r_typ;

            calculate_crossing_points();
        }
        /// <summary>
        /// Constructor to initialize NaturalFeature as a Chasm.
        /// </summary>
        /// <param name="chasm_start"></param>
        /// <param name="chasm_end"></param>
        /// <param name="max_thickness"></param>
        public NaturalFeature(gridCoordinate chasm_start, gridCoordinate chasm_end, int max_thickness)
        {
            feature_startCoord = chasm_start;
            feature_endCoord = chasm_end;
            maximum_thickness = max_thickness;
            my_fType = Feature_Type.Chasm;

            int a = Math.Abs(feature_startCoord.x - feature_endCoord.x);
            int b = Math.Abs(feature_startCoord.y - feature_endCoord.y);
            chasm_length = (int)Math.Sqrt((a * a) + (b * b));
            Random rGen = new Random();

            int max_length = chasm_length - 3;
            int min_length = Math.Min(4, max_length - 1);

            cavern_point = rGen.Next(min_length, max_length);
            cavern_right = true;
            if (rGen.Next(2) == 0)
                cavern_right = false;
        }
        /// <summary>
        /// Constructor to initialize NaturalFeature as a lake.
        /// </summary>
        /// <returns></returns>
        public NaturalFeature(gridCoordinate lake_start, gridCoordinate lake_end,
                              int room_thickness, int shore_thickness, int shallow_thickness)
        {
            my_fType = Feature_Type.Lake;

            feature_startCoord = lake_start;
            feature_endCoord = lake_end;
            lake_roomthickness = room_thickness;
            lake_shorethickness = shore_thickness;
            lake_shallowsthickness = shallow_thickness;
        }
        public NaturalFeature(FeatureDC base_feature)
        {
            my_fType = (Feature_Type)Enum.Parse(typeof(Feature_Type), base_feature.FeatureType);
            my_rivType = (River_Type)Enum.Parse(typeof(River_Type), base_feature.RiverType);

            feature_startCoord = grid_c_from_matrix_c(base_feature.Start_Coord);
            feature_endCoord = grid_c_from_matrix_c(base_feature.End_Coord);

            banks_thickness = -1;
            shallow_thickness = -1;
            deepwater_thickness = -1;
            lake_roomthickness = -1;
            lake_shorethickness = -1;
            lake_shallowsthickness = -1;

            if (my_fType == Feature_Type.Lake)
            {
                lake_roomthickness = base_feature.Lake_Room_Thickness;
                lake_shorethickness = base_feature.Lake_Shore_Thickness;
                lake_shallowsthickness = base_feature.Lake_Shallows_Thickness;
            }
            else if (my_fType == Feature_Type.River)
            {
                banks_thickness = base_feature.River_Shore_Thickness;
                shallow_thickness = base_feature.River_Shallows_Thickness;
                deepwater_thickness = base_feature.River_Depths_Thickness;

                calculate_crossing_points();
            }
        }