Exemple #1
0
        private async Task <FileContentResult> ExportWithCustomFrontend(
            IEnumerable <ClaimListItemViewModel> viewModel, string title,
            ExportType exportType, IGeneratorFrontend <ClaimListItemViewModel> frontend, string projectName)
        {
            var generator = ExportDataService.GetGenerator(exportType, viewModel,
                                                           frontend);

            var fileName = projectName + ": " + title;

            return(File(await generator.Generate(), generator.ContentType,
                        Path.ChangeExtension(fileName.ToSafeFileName(), generator.FileExtension)));
        }
        public WorldGenerator(IGeneratorFrontend frontend)
        {
            Frontend = frontend;

            int mapWidth  = Settings.MapWidth;
            int mapHeight = Settings.MapHeight;

            SectorsX     = mapWidth / SectorWidth;
            SectorsY     = mapHeight / SectorHeight;
            TopologyMap  = new Bitmap(mapWidth, mapHeight);
            TerrainMap   = new Bitmap(mapWidth, mapHeight);
            RiversMap    = new Bitmap(mapWidth, mapHeight);
            ProvincesMap = new Bitmap(mapWidth, mapHeight);
            CulturesMap  = new Bitmap(mapWidth, mapHeight);
            //MapGenerator = new ProceduralHeightmap(mapWidth, mapHeight, 128, 64, 0.65, 0.05, false, false, true);
            MapGenerator = new MapGenerator(Settings);
            ProvinceGrid = new Province[mapWidth, mapHeight];
        }
Exemple #3
0
        protected Task <FileContentResult> ExportWithCustomFronend <T>(IEnumerable <T> viewModel, string title,
                                                                       ExportType exportType, IGeneratorFrontend frontend, string projectName)
        {
            var generator = ExportDataService.GetGenerator(exportType, viewModel,
                                                           frontend);

            return(ReturnExportResult(projectName + ": " + title, generator));
        }
 public TableGenerator(IEnumerable <TRow> data, IGeneratorBackend backend, IGeneratorFrontend frontend)
 {
     Data     = data;
     Backend  = backend;
     Frontend = frontend;
 }
 public IExportGenerator GetGenerator <T>(ExportType type, IEnumerable <T> data, IGeneratorFrontend frontend)
 {
     return(new TableGenerator <T>(data, GetGeneratorBackend(type), frontend));
 }
Exemple #6
0
 public IExportGenerator GetGenerator <T>(ExportType type, IEnumerable <T> data, IGeneratorFrontend <T> frontend)
     where T : class
 => new TableGenerator <T>(data, GetGeneratorBackend(type), frontend);