Skip to content

Commit

Permalink
Quicktypes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Jun 12, 2023
1 parent a2965f1 commit d74c2fa
Show file tree
Hide file tree
Showing 6 changed files with 383 additions and 619 deletions.
26 changes: 26 additions & 0 deletions docs/quicktype/LdtkJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ namespace quicktype {
boost::optional<std::string> doc;
bool editor_always_show;
bool editor_cut_long_values;
boost::optional<std::string> editor_display_color;
EditorDisplayMode editor_display_mode;
EditorDisplayPos editor_display_pos;
double editor_display_scale;
Expand Down Expand Up @@ -267,6 +268,9 @@ namespace quicktype {
bool & get_mutable_editor_cut_long_values() { return editor_cut_long_values; }
void set_editor_cut_long_values(const bool & value) { this->editor_cut_long_values = value; }

boost::optional<std::string> get_editor_display_color() const { return editor_display_color; }
void set_editor_display_color(boost::optional<std::string> value) { this->editor_display_color = value; }

/**
* Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`,
* `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`,
Expand Down Expand Up @@ -2726,6 +2730,8 @@ namespace quicktype {
boost::optional<std::string> backup_rel_path;
std::string bg_color;
std::vector<LdtkCustomCommand> custom_commands;
int64_t default_entity_height;
int64_t default_entity_width;
int64_t default_grid_size;
std::string default_level_bg_color;
boost::optional<int64_t> default_level_height;
Expand Down Expand Up @@ -2810,6 +2816,20 @@ namespace quicktype {
std::vector<LdtkCustomCommand> & get_mutable_custom_commands() { return custom_commands; }
void set_custom_commands(const std::vector<LdtkCustomCommand> & value) { this->custom_commands = value; }

/**
* Default height for new entities
*/
const int64_t & get_default_entity_height() const { return default_entity_height; }
int64_t & get_mutable_default_entity_height() { return default_entity_height; }
void set_default_entity_height(const int64_t & value) { this->default_entity_height = value; }

/**
* Default width for new entities
*/
const int64_t & get_default_entity_width() const { return default_entity_width; }
int64_t & get_mutable_default_entity_width() { return default_entity_width; }
void set_default_entity_width(const int64_t & value) { this->default_entity_width = value; }

/**
* Default grid size for new layers
*/
Expand Down Expand Up @@ -3208,6 +3228,7 @@ namespace quicktype {
x.set_doc(get_stack_optional<std::string>(j, "doc"));
x.set_editor_always_show(j.at("editorAlwaysShow").get<bool>());
x.set_editor_cut_long_values(j.at("editorCutLongValues").get<bool>());
x.set_editor_display_color(get_stack_optional<std::string>(j, "editorDisplayColor"));
x.set_editor_display_mode(j.at("editorDisplayMode").get<EditorDisplayMode>());
x.set_editor_display_pos(j.at("editorDisplayPos").get<EditorDisplayPos>());
x.set_editor_display_scale(j.at("editorDisplayScale").get<double>());
Expand Down Expand Up @@ -3244,6 +3265,7 @@ namespace quicktype {
j["doc"] = x.get_doc();
j["editorAlwaysShow"] = x.get_editor_always_show();
j["editorCutLongValues"] = x.get_editor_cut_long_values();
j["editorDisplayColor"] = x.get_editor_display_color();
j["editorDisplayMode"] = x.get_editor_display_mode();
j["editorDisplayPos"] = x.get_editor_display_pos();
j["editorDisplayScale"] = x.get_editor_display_scale();
Expand Down Expand Up @@ -3975,6 +3997,8 @@ namespace quicktype {
x.set_backup_rel_path(get_stack_optional<std::string>(j, "backupRelPath"));
x.set_bg_color(j.at("bgColor").get<std::string>());
x.set_custom_commands(j.at("customCommands").get<std::vector<LdtkCustomCommand>>());
x.set_default_entity_height(j.at("defaultEntityHeight").get<int64_t>());
x.set_default_entity_width(j.at("defaultEntityWidth").get<int64_t>());
x.set_default_grid_size(j.at("defaultGridSize").get<int64_t>());
x.set_default_level_bg_color(j.at("defaultLevelBgColor").get<std::string>());
x.set_default_level_height(get_stack_optional<int64_t>(j, "defaultLevelHeight"));
Expand Down Expand Up @@ -4015,6 +4039,8 @@ namespace quicktype {
j["backupRelPath"] = x.get_backup_rel_path();
j["bgColor"] = x.get_bg_color();
j["customCommands"] = x.get_custom_commands();
j["defaultEntityHeight"] = x.get_default_entity_height();
j["defaultEntityWidth"] = x.get_default_entity_width();
j["defaultGridSize"] = x.get_default_grid_size();
j["defaultLevelBgColor"] = x.get_default_level_bg_color();
j["defaultLevelHeight"] = x.get_default_level_height();
Expand Down
15 changes: 15 additions & 0 deletions docs/quicktype/LdtkJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ public partial class LdtkJson
[JsonProperty("customCommands")]
public LdtkCustomCommand[] CustomCommands { get; set; }

/// <summary>
/// Default height for new entities
/// </summary>
[JsonProperty("defaultEntityHeight")]
public long DefaultEntityHeight { get; set; }

/// <summary>
/// Default width for new entities
/// </summary>
[JsonProperty("defaultEntityWidth")]
public long DefaultEntityWidth { get; set; }

/// <summary>
/// Default grid size for new layers
/// </summary>
Expand Down Expand Up @@ -612,6 +624,9 @@ public partial class FieldDefinition
[JsonProperty("editorCutLongValues")]
public bool EditorCutLongValues { get; set; }

[JsonProperty("editorDisplayColor")]
public string EditorDisplayColor { get; set; }

/// <summary>
/// Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`,
/// `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`,
Expand Down
5 changes: 5 additions & 0 deletions docs/quicktype/LdtkJson.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ type LdtkJSON struct {
BgColor string `json:"bgColor"`
// An array of command lines that can be ran manually by the user
CustomCommands []LdtkCustomCommand `json:"customCommands"`
// Default height for new entities
DefaultEntityHeight int64 `json:"defaultEntityHeight"`
// Default width for new entities
DefaultEntityWidth int64 `json:"defaultEntityWidth"`
// Default grid size for new layers
DefaultGridSize int64 `json:"defaultGridSize"`
// Default background color of levels
Expand Down Expand Up @@ -270,6 +274,7 @@ type FieldDefinition struct {
Doc *string `json:"doc"`
EditorAlwaysShow bool `json:"editorAlwaysShow"`
EditorCutLongValues bool `json:"editorCutLongValues"`
EditorDisplayColor *string `json:"editorDisplayColor"`
// Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`,
// `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`,
// `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`,
Expand Down
3 changes: 3 additions & 0 deletions docs/quicktype/LdtkJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ const typeMap = {
{ json: "backupRelPath", js: "backupRelPath", typ: u(undefined, u(null, "")) },
{ json: "bgColor", js: "bgColor", typ: "" },
{ json: "customCommands", js: "customCommands", typ: a(r("LdtkCustomCommand")) },
{ json: "defaultEntityHeight", js: "defaultEntityHeight", typ: 0 },
{ json: "defaultEntityWidth", js: "defaultEntityWidth", typ: 0 },
{ json: "defaultGridSize", js: "defaultGridSize", typ: 0 },
{ json: "defaultLevelBgColor", js: "defaultLevelBgColor", typ: "" },
{ json: "defaultLevelHeight", js: "defaultLevelHeight", typ: u(undefined, u(0, null)) },
Expand Down Expand Up @@ -337,6 +339,7 @@ const typeMap = {
{ json: "doc", js: "doc", typ: u(undefined, u(null, "")) },
{ json: "editorAlwaysShow", js: "editorAlwaysShow", typ: true },
{ json: "editorCutLongValues", js: "editorCutLongValues", typ: true },
{ json: "editorDisplayColor", js: "editorDisplayColor", typ: u(undefined, u(null, "")) },
{ json: "editorDisplayMode", js: "editorDisplayMode", typ: r("EditorDisplayMode") },
{ json: "editorDisplayPos", js: "editorDisplayPos", typ: r("EditorDisplayPos") },
{ json: "editorDisplayScale", js: "editorDisplayScale", typ: 3.14 },
Expand Down
Loading

0 comments on commit d74c2fa

Please sign in to comment.