// Copyright (c) 2023 Dominic Masters // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #include "VNSetEventParser.hpp" using namespace Dawn; std::vector VNSetEventParser::getRequiredAttributes() { return { "property", "type" }; } std::map VNSetEventParser::getOptionalAttributes() { return { { "to", "" }, { "value", "" }, { "from", "" }, { "duration", "" }, { "curve", "" } }; } int32_t VNSetEventParser::onParse( Xml *node, std::map values, struct VNSetEvent *out, std::string *error ) { if(values["to"] != "") { out->to = values["to"]; } else if(values["value"] != "") { out->to = values["value"]; } else { *error = "Either 'to' or 'value' must be specified"; return -1; } out->type = values["type"]; out->property = values["property"]; out->from = values["from"]; out->duration = values["duration"]; out->curve = values["curve"]; return 0; }