public async Task WriteFile <T>(Export.ExportTypes export, IEnumerable <T> data) { var file = await ChooseFileLocation(export); var writer = new Export.ExportWriter(file); switch (export) { case Export.ExportTypes.Dungeon: await WriteDungeon(writer, data as IEnumerable <AdventureData>); break; case Export.ExportTypes.Person: await WriteNPC(writer, data as IEnumerable <PersonData>); break; case Export.ExportTypes.Settlement: await WriteSettlement(writer, data as IEnumerable <Settlement>); break; } return; }
private async Task WriteDungeon(Export.ExportWriter e, IEnumerable <AdventureData> data) { var exporter = new Export.DungeonExporter(); await e.WriteFile(exporter, data); }
private async Task WriteSettlement(Export.ExportWriter e, IEnumerable <Settlement> data) { var exporter = new Export.SettlementExporter(); await e.WriteFile(exporter, data); }
private async Task WriteNPC(Export.ExportWriter e, IEnumerable <PersonData> data) { var exporter = new Export.PersonExporter(); await e.WriteFile(exporter, data); }