-
Notifications
You must be signed in to change notification settings - Fork 0
JSON File
NebelFox edited this page Feb 19, 2022
·
3 revisions
Serializer and BoxSerializer accept json files of specific structure:
{
"styles": {
"style-1-name": {
/*style definition*/
},
"style-2-name": {
/*style definition*/
}
},
"boxes": {
"box-1-name": {
/*box definition*/
},
"box-2-name": {
/*box definition*/
}
}
}
boxes
accepts named Box objects, styles
- named Style objects
As you may notice, both
styles
andboxes
properties have similar semantics.
Names, given to definitions, are used to retrieve them from deserializers and allow inheritance.
sample.json
{
"styles": {
"style": {
"dialogue.greeting": "Just to fill the style"
}
},
"boxes": {
"box": {
"commands": [
"command"
]
}
}
}
Program.cs
using System;
using System.Collections.Generic;
using Verbox;
using Verbox.Text.Serialization;
var serializer = new Serializer();
serializer.Deserialize("sample.json");
var builder = serializer.Boxes["box"]
.Style(seriaizer.Styles["style"]);
- General:
- File Specification:
- Templates:
- Tips