mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Use make_intrusive/make_shared for smart pointer construction.
This commit is contained in:
+9
-9
@@ -76,15 +76,15 @@ intrusive_ptr<Field> read_new<Field>(Reader& reader) {
|
||||
// there must be a type specified
|
||||
String type;
|
||||
reader.handle(_("type"), type);
|
||||
if (type == _("text")) return intrusive(new TextField());
|
||||
else if (type == _("choice")) return intrusive(new ChoiceField());
|
||||
else if (type == _("multiple choice")) return intrusive(new MultipleChoiceField());
|
||||
else if (type == _("boolean")) return intrusive(new BooleanField());
|
||||
else if (type == _("image")) return intrusive(new ImageField());
|
||||
else if (type == _("symbol")) return intrusive(new SymbolField());
|
||||
else if (type == _("color")) return intrusive(new ColorField());
|
||||
else if (type == _("info")) return intrusive(new InfoField());
|
||||
else if (type == _("package choice")) return intrusive(new PackageChoiceField());
|
||||
if (type == _("text")) return make_intrusive<TextField>();
|
||||
else if (type == _("choice")) return make_intrusive<ChoiceField>();
|
||||
else if (type == _("multiple choice")) return make_intrusive<MultipleChoiceField>();
|
||||
else if (type == _("boolean")) return make_intrusive<BooleanField>();
|
||||
else if (type == _("image")) return make_intrusive<ImageField>();
|
||||
else if (type == _("symbol")) return make_intrusive<SymbolField>();
|
||||
else if (type == _("color")) return make_intrusive<ColorField>();
|
||||
else if (type == _("info")) return make_intrusive<InfoField>();
|
||||
else if (type == _("package choice")) return make_intrusive<PackageChoiceField>();
|
||||
else if (type.empty()) {
|
||||
reader.warning(_ERROR_1_("expected key", _("type")));
|
||||
throw ParseError(_ERROR_("aborting parsing"));
|
||||
|
||||
Reference in New Issue
Block a user