示例#1
0
        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;
        }
示例#2
0
 private async Task WriteDungeon(Export.ExportWriter e, IEnumerable <AdventureData> data)
 {
     var exporter = new Export.DungeonExporter();
     await e.WriteFile(exporter, data);
 }
示例#3
0
 private async Task WriteSettlement(Export.ExportWriter e, IEnumerable <Settlement> data)
 {
     var exporter = new Export.SettlementExporter();
     await e.WriteFile(exporter, data);
 }
示例#4
0
 private async Task WriteNPC(Export.ExportWriter e, IEnumerable <PersonData> data)
 {
     var exporter = new Export.PersonExporter();
     await e.WriteFile(exporter, data);
 }