Пример #1
0
 public static List<IFeatures> GetClimateFeatures(IClimate climate)
 {
     switch (climate.GetType().Name.ToLower())
     {
         case "alpine":
             return AlpineFeatures();
         case "chaparral":
             return ChaparralFeatures();
         case "deciduousforest":
             return DeciduousForestFeatures();
         case "desert":
             return DesertFeatures();
         case "grassland":
             return GrasslandFeatures();
         case "rainforest":
             return RainforestFeatures();
         case "savanna":
             return SavannaFeatures();
         case "steppe":
             return SteppeFeatures();
         case "taiga":
             return TaigaFeatures();
         case "tundra":
         default:
             return TundraFeatures();
     }
 }
Пример #2
0
        public static IFeatures PopulateHighlands(int id, IClimate climate)
        {
            // now we need to exlude features. For example, if the climate is a Savanna then we shouldn't have forests
            int featureId = 0;
            switch (climate.GetType().Name.ToLower())
            {
                case "grassland":
                    featureId = (id < 3) ? _Random.Next(3, 10) : id;
                    break;
                case "chaparral":
                    featureId = (id < 3) ? _Random.Next(3, 10) : id;
                    break;
                case "desert":
                    featureId = (id < 3) ? _Random.Next(3, 10) : id;
                    break;
                case "savanna":
                    featureId = (id < 3) ? _Random.Next(3, 10) : id;
                    break;
                case "steppe":
                    featureId = (id < 3) ? _Random.Next(3, 10) : id;
                    break;
                case "tundra":
                    featureId = (id < 3) ? _Random.Next(3, 10) : id;
                    break;
            }

            switch (id)
            {
                case 0:
                    return new Forest();
                case 1:
                    return new Forest();
                case 2:
                    return new Forest(); // skip these if climate is of type...
                case 3:
                    return new Caves();
                case 4:
                    return new Faults();
                case 5:
                    return new Ridges();
                case 6:
                    return new Ridges();
                case 7:
                    return new Talus();
                case 8:
                    return new Rivers();
                case 9:
                default:
                    return new Shrubland();
            }
        }
Пример #3
0
 private string ClimateSwitch(IClimate climate)
 {
     switch(climate.GetType().Name.ToLower())
     {
         case "alpine":
             return Forests();
         case "chaparral":
             return FlatLands();
         case "deciduousforest":
             return Forests();
         case "desert":
             return Deserts();
         case "grassland":
             return FlatLands();
         case "rainforest":
             return Forests();
         case "savanna":
             return Savannas();
         case "steppe":
             return Steppes();
         case "taiga":
             return Arctic();
         case "tundra":
         default:
             return Arctic();
     }
 }