80 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			80 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| // 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"
 | |
| #include "VNMarkerParser.hpp"
 | |
| #include "VNGoToMarkerEventParser.hpp"
 | |
| #include "VNChoiceEventParser.hpp"
 | |
| #include "VNChoiceSetEventParser.hpp"
 | |
| #include "VNIfEventParser.hpp"
 | |
| #include "VNSceneChangeEventParser.hpp"
 | |
| #include "VNSetDefaultFontEventParser.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,
 | |
|     VN_SCENE_EVENT_TYPE_MARKER,
 | |
|     VN_SCENE_EVENT_TYPE_GOTO_MARKER,
 | |
|     VN_SCENE_EVENT_TYPE_CHOICES,
 | |
|     VN_SCENE_EVENT_TYPE_CHOICE_SET,
 | |
|     VN_SCENE_EVENT_TYPE_IF,
 | |
|     VN_SCENE_EVENT_TYPE_SCENE_CHANGE,
 | |
|     VN_SCENE_EVENT_SET_DEFAULT_FONT
 | |
|   };
 | |
| 
 | |
|   struct VNParallelEvent {
 | |
|     struct VNSceneEventList events;
 | |
|   };
 | |
|   
 | |
|   struct VNIfEvent {
 | |
|     std::string key;
 | |
|     std::string value;
 | |
|     struct VNSceneEventList events;
 | |
|   };
 | |
| 
 | |
|   struct VNSceneEvent {
 | |
|     enum VNSceneEventType type;
 | |
|     
 | |
|     struct VNTextEvent text;
 | |
|     struct VNPositionEvent position;
 | |
|     struct VNSetEvent set;
 | |
|     struct VNWaitEvent wait;
 | |
|     struct VNParallelEvent parallel;
 | |
|     struct VNMarker marker;
 | |
|     struct VNGoToMarkerEvent gotoMarker;
 | |
|     struct VNChoiceEvent choices;
 | |
|     struct VNChoiceSetEvent choiceSet;
 | |
|     struct VNIfEvent ifEvent;
 | |
|     struct VNSceneChangeEvent sceneChange;
 | |
|     struct VNSetFont setDefaultFont;
 | |
|   };
 | |
| 
 | |
|   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;
 | |
|   };
 | |
| } |