Exemplo n.º 1
0
 //TODO this is ugly. Configuration should not have functions
 public Ring2RegionsDbGeneratorConfiguration Ring2RegionsDbGeneratorConfiguration(
     Ring2AreaDistanceDatabase distanceDatabase)
 {
     return(new Ring2RegionsDbGeneratorConfiguration()
     {
         FromHabitatTemplates = HabitatTemplatesCreator(distanceDatabase),
         FromPathsTemplate = FromPathsTemplate(distanceDatabase),
         PathWidth = 4,
         Ring2RoadsQueryArea = Repositioner.InvMove(new MyRectangle(0, 0, 1080, 1080)),
         GenerateRoadHabitats = true
     });
 }
Exemplo n.º 2
0
 public Ring2RegionFromHabitatTemplate FromPathsTemplate(Ring2AreaDistanceDatabase distanceDatabase)
 {
     return(new Ring2RegionFromHabitatTemplate()
     {
         Fabrics = new List <Ring2Fabric>()
         {
             new Ring2Fabric(Ring2Fiber.DrySandFiber, new Ring2FabricColors(
                                 _colorsConfiguration.ColorPaletteFile.RetriveList(ColorPaletteLines.Road1, 4)),
                             new FromAreaEdgeDistanceRing2IntensityProvider(0.2f, distanceDatabase), 1, 5),
             new Ring2Fabric(Ring2Fiber.DottedTerrainFiber, new Ring2FabricColors(
                                 _colorsConfiguration.ColorPaletteFile.RetriveList(ColorPaletteLines.Road1_Dots, 4)),
                             new FromAreaEdgeDistanceRing2IntensityProvider(0.4f, distanceDatabase), 0.8f, 5),
         },
         Magnitude = 10,
         BufferLength = 1
     });
 }
Exemplo n.º 3
0
 public Dictionary <HabitatType, Ring2RegionFromHabitatTemplate> HabitatTemplatesCreator(
     Ring2AreaDistanceDatabase distanceDatabase)
 {
     return(new Dictionary <HabitatType, Ring2RegionFromHabitatTemplate>()
     {
         {
             HabitatType.Forest, new Ring2RegionFromHabitatTemplate()
             {
                 Fabrics = new List <Ring2Fabric>()
                 {
                     new Ring2Fabric(Ring2Fiber.BaseGroundFiber, new Ring2FabricColors(
                                         _colorsConfiguration.ColorPaletteFile.RetriveList(
                                             ColorPaletteLines.Ring2_Habitat_Forrest_Ground, 4))
                                     , new FromAreaEdgeDistanceRing2IntensityProvider(5f, distanceDatabase), 0.3f, 1),
                     new Ring2Fabric(Ring2Fiber.GrassyFieldFiber, new Ring2FabricColors(
                                         _colorsConfiguration.ColorPaletteFile.RetriveList(
                                             ColorPaletteLines.Ring2_Habitat_Forrest_GrassyField, 4))
                                     , new FromAreaEdgeDistanceRing2IntensityProvider(1.3f, distanceDatabase), 0.6f, 1)
                 },
                 Magnitude = 1,
                 BufferLength = 5
             }
         },
         {
             HabitatType.Fell, new Ring2RegionFromHabitatTemplate()
             {
                 Fabrics = new List <Ring2Fabric>()
                 {
                     new Ring2Fabric(Ring2Fiber.BaseGroundFiber, new Ring2FabricColors(
                                         _colorsConfiguration.ColorPaletteFile.RetriveList(
                                             ColorPaletteLines.Ring2_Habitat_Fell_Ground, 4))
                                     , new FromAreaEdgeDistanceRing2IntensityProvider(5f, distanceDatabase), 0.4f, 1),
                     new Ring2Fabric(Ring2Fiber.GrassyFieldFiber, new Ring2FabricColors(
                                         _colorsConfiguration.ColorPaletteFile.RetriveList(
                                             ColorPaletteLines.Ring2_Habitat_Fell_GrassyField, 4))
                                     , new FromAreaEdgeDistanceRing2IntensityProvider(1.3f, distanceDatabase), 0.65f, 1)
                 },
                 Magnitude = 2,
                 BufferLength = 3
             }
         },
         {
             HabitatType.NotSpecified, new Ring2RegionFromHabitatTemplate()
             {
                 Fabrics = new List <Ring2Fabric>()
                 {
                     new Ring2Fabric(Ring2Fiber.DottedTerrainFiber, new Ring2FabricColors(
                                         _colorsConfiguration.ColorPaletteFile.RetriveList(
                                             ColorPaletteLines.Ring2_Habitat_Not_Specified_Dotted, 4)),
                                     new FromAreaEdgeDistanceRing2IntensityProvider(1.3f, distanceDatabase), 0.4f, 1),
                     new Ring2Fabric(Ring2Fiber.BaseGroundFiber, new Ring2FabricColors(
                                         _colorsConfiguration.ColorPaletteFile.RetriveList(
                                             ColorPaletteLines.Ring2_Habitat_Not_Specified_Ground, 4)),
                                     new FromAreaEdgeDistanceRing2IntensityProvider(5f, distanceDatabase), 0.3f, 1f),
                 },
                 Magnitude = 3,
                 BufferLength = 3
             }
         },
         {
             HabitatType.Grassland, new Ring2RegionFromHabitatTemplate()
             {
                 Fabrics = new List <Ring2Fabric>()
                 {
                     new Ring2Fabric(Ring2Fiber.GrassyFieldFiber, new Ring2FabricColors(
                                         _colorsConfiguration.ColorPaletteFile.RetriveList(
                                             ColorPaletteLines.Ring2_Habitat_Grassland_GrassyField, 4)),
                                     new FromAreaEdgeDistanceRing2IntensityProvider(1.3f, distanceDatabase), 0.7f, 1),
                     new Ring2Fabric(Ring2Fiber.BaseGroundFiber, new Ring2FabricColors(
                                         _colorsConfiguration.ColorPaletteFile.RetriveList(
                                             ColorPaletteLines.Ring2_Habitat_Grassland_Ground, 4)),
                                     new FromAreaEdgeDistanceRing2IntensityProvider(1.3f, distanceDatabase), 0.3f, 1)
                 },
                 Magnitude = 3,
                 BufferLength = 3
             }
         },
         {
             HabitatType.Meadow, new Ring2RegionFromHabitatTemplate()
             {
                 Fabrics = new List <Ring2Fabric>()
                 {
                     new Ring2Fabric(Ring2Fiber.DrySandFiber, new Ring2FabricColors(
                                         _colorsConfiguration.ColorPaletteFile.RetriveList(
                                             ColorPaletteLines.Ring2_Habitat_Meadow_DrySand, 4)),
                                     new FromAreaEdgeDistanceRing2IntensityProvider(1.3f, distanceDatabase), 0.7f, 1)
                 },
                 Magnitude = 3,
                 BufferLength = 3
             }
         },
         {
             HabitatType.Scrub, new Ring2RegionFromHabitatTemplate()
             {
                 Fabrics = new List <Ring2Fabric>()
                 {
                     new Ring2Fabric(Ring2Fiber.GrassyFieldFiber, new Ring2FabricColors(
                                         _colorsConfiguration.ColorPaletteFile.RetriveList(
                                             ColorPaletteLines.Ring2_Habitat_Meadow_DrySand, 4)),
                                     new FromAreaEdgeDistanceRing2IntensityProvider(1.3f, distanceDatabase), 0.75f, 1)
                 },
                 Magnitude = 3,
                 BufferLength = 3
             }
         },
     });
 }