Just breaking stuff
This commit is contained in:
48
archive/vnscenegen/parse/event/pauseevent.hpp
Normal file
48
archive/vnscenegen/parse/event/pauseevent.hpp
Normal file
@ -0,0 +1,48 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "util/XmlParser.hpp"
|
||||
#include "util/CodeGen.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
struct PauseEventInfo {
|
||||
std::string duration;
|
||||
std::string include;
|
||||
};
|
||||
|
||||
class PauseEventParser : public XmlParser<struct PauseEventInfo> {
|
||||
protected:
|
||||
std::vector<std::string> getRequiredAttributes() {
|
||||
return std::vector<std::string>{ "duration" };
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> getOptionalAttributes() {
|
||||
return std::map<std::string, std::string>();
|
||||
}
|
||||
|
||||
int32_t onParse(
|
||||
Xml *node,
|
||||
std::map<std::string, std::string> values,
|
||||
struct PauseEventInfo *out,
|
||||
std::string *error
|
||||
) {
|
||||
out->duration = parseDuration(values["duration"]);
|
||||
out->include = "visualnovel/events/timing/VisualNovelPauseEvent.hpp";
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
class PauseEventGen : public CodeGen {
|
||||
public:
|
||||
static void generate(
|
||||
std::vector<std::string> *out,
|
||||
struct PauseEventInfo *info,
|
||||
std::string tabs = ""
|
||||
) {
|
||||
line(out, "new VisualNovelPauseEvent(vnManager, " + info->duration + ")", tabs);
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user