Moved C++ tools out
This commit is contained in:
35
archive/dawntools/vnscenetool/events/VNWaitEventParser.cpp
Normal file
35
archive/dawntools/vnscenetool/events/VNWaitEventParser.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "VNWaitEventParser.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
std::vector<std::string> VNWaitEventParser::getRequiredAttributes() {
|
||||
return { };
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> VNWaitEventParser::getOptionalAttributes() {
|
||||
return { { "duration", "" }, { "time", "" } };
|
||||
}
|
||||
|
||||
int32_t VNWaitEventParser::onParse(
|
||||
Xml *node,
|
||||
std::map<std::string, std::string> values,
|
||||
VNWaitEvent *out,
|
||||
std::string *error
|
||||
) {
|
||||
//Get the duration
|
||||
if(!values["duration"].empty()) {
|
||||
out->duration = values["duration"];
|
||||
} else if(!values["time"].empty()) {
|
||||
out->duration = values["time"];
|
||||
} else {
|
||||
*error = "No duration specified.";
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user