mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
implemented import formats
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@102 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -18,9 +18,9 @@ DECLARE_TYPEOF_COLLECTION(FileFormatP);
|
||||
vector<FileFormatP> file_formats;
|
||||
|
||||
void init_file_formats() {
|
||||
//file_formats.push_back(new_shared<MSE2FileFilter>());
|
||||
//file_formats.push_back(new_shared<MSE1FileFilter>());
|
||||
//file_formats.push_back(new_shared<MtgEditorFileFilter>());
|
||||
file_formats.push_back(mse2_file_format());
|
||||
file_formats.push_back(mse1_file_format());
|
||||
file_formats.push_back(mtg_editor_file_format());
|
||||
}
|
||||
|
||||
String import_formats() {
|
||||
@@ -47,7 +47,7 @@ String export_formats(const Game& game) {
|
||||
return type_strings;
|
||||
}
|
||||
|
||||
void export_set(const Set& set, const String& filename, size_t format_type) {
|
||||
void export_set(Set& set, const String& filename, size_t format_type) {
|
||||
FileFormatP format = file_formats.at(format_type);
|
||||
if (!format->canExport(*set.game)) {
|
||||
throw InternalError(_("File format doesn't apply to set"));
|
||||
@@ -67,4 +67,4 @@ SetP import_set(String name) {
|
||||
// default: use first format = MSE2 format
|
||||
assert(!file_formats.empty() && file_formats[0]->canImport());
|
||||
return file_formats[0]->importSet(name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user