Parallel event processing

This commit is contained in:
2023-04-24 20:04:31 -07:00
parent d105f9e4ab
commit 87d12982d1
13 changed files with 243 additions and 78 deletions

View File

@ -0,0 +1,53 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "VNTextEventParser.hpp"
#include "VNPositionEventParser.hpp"
#include "VNSetEventParser.hpp"
#include "VNWaitEventParser.hpp"
#include "VNParallelEventParser.hpp"
namespace Dawn {
struct VNSceneEvent;
struct VNSceneEventList {
std::vector<struct VNSceneEvent> events;
};
enum VNSceneEventType {
VN_SCENE_EVENT_TYPE_TEXT,
VN_SCENE_EVENT_TYPE_POSITION,
VN_SCENE_EVENT_TYPE_SET,
VN_SCENE_EVENT_TYPE_WAIT,
VN_SCENE_EVENT_TYPE_PARALLEL
};
struct VNParallelEvent {
struct VNSceneEventList events;
};
struct VNSceneEvent {
enum VNSceneEventType type;
struct VNTextEvent text;
struct VNPositionEvent position;
struct VNSetEvent set;
struct VNWaitEvent wait;
struct VNParallelEvent parallel;
};
class VNSceneEventsParser : public XmlParser<struct VNSceneEventList> {
protected:
std::vector<std::string> getRequiredAttributes() override;
std::map<std::string, std::string> getOptionalAttributes() override;
int32_t onParse(
Xml *node,
std::map<std::string, std::string> values,
struct VNSceneEventList *out,
std::string *error
) override;
};
}