forked from glideapps/quicktype
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathldtk.cs
2909 lines (2515 loc) · 107 KB
/
ldtk.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// <auto-generated />
//
// To parse this JSON data, add NuGet 'System.Text.Json' then do:
//
// using QuickType;
//
// var ldtk = Ldtk.FromJson(jsonString);
namespace QuickType
{
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
/// <summary>
/// This file is a JSON schema of files created by LDtk level editor (https://ldtk.io).
///
/// This is the root of any Project JSON file. It contains: - the project settings, - an
/// array of levels, - a group of definitions (that can probably be safely ignored for most
/// users).
/// </summary>
public partial class Ldtk
{
/// <summary>
/// This object is not actually used by LDtk. It ONLY exists to force explicit references to
/// all types, to make sure QuickType finds them and integrate all of them. Otherwise,
/// Quicktype will drop types that are not explicitely used.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("__FORCED_REFS")]
public ForcedRefs ForcedRefs { get; set; }
/// <summary>
/// LDtk application build identifier.<br/> This is only used to identify the LDtk version
/// that generated this particular project file, which can be useful for specific bug fixing.
/// Note that the build identifier is just the date of the release, so it's not unique to
/// each user (one single global ID per LDtk public release), and as a result, completely
/// anonymous.
/// </summary>
[JsonPropertyName("appBuildId")]
public double AppBuildId { get; set; }
/// <summary>
/// Number of backup files to keep, if the `backupOnSave` is TRUE
/// </summary>
[JsonPropertyName("backupLimit")]
public long BackupLimit { get; set; }
/// <summary>
/// If TRUE, an extra copy of the project will be created in a sub folder, when saving.
/// </summary>
[JsonPropertyName("backupOnSave")]
public bool BackupOnSave { get; set; }
/// <summary>
/// Project background color
/// </summary>
[JsonPropertyName("bgColor")]
public string BgColor { get; set; }
/// <summary>
/// Default grid size for new layers
/// </summary>
[JsonPropertyName("defaultGridSize")]
public long DefaultGridSize { get; set; }
/// <summary>
/// Default background color of levels
/// </summary>
[JsonPropertyName("defaultLevelBgColor")]
public string DefaultLevelBgColor { get; set; }
/// <summary>
/// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update.
/// It will then be `null`. You can enable the Multi-worlds advanced project option to enable
/// the change immediately.<br/><br/> Default new level height
/// </summary>
[JsonPropertyName("defaultLevelHeight")]
public long? DefaultLevelHeight { get; set; }
/// <summary>
/// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update.
/// It will then be `null`. You can enable the Multi-worlds advanced project option to enable
/// the change immediately.<br/><br/> Default new level width
/// </summary>
[JsonPropertyName("defaultLevelWidth")]
public long? DefaultLevelWidth { get; set; }
/// <summary>
/// Default X pivot (0 to 1) for new entities
/// </summary>
[JsonPropertyName("defaultPivotX")]
public double DefaultPivotX { get; set; }
/// <summary>
/// Default Y pivot (0 to 1) for new entities
/// </summary>
[JsonPropertyName("defaultPivotY")]
public double DefaultPivotY { get; set; }
/// <summary>
/// A structure containing all the definitions of this project
/// </summary>
[JsonPropertyName("defs")]
public Definitions Defs { get; set; }
/// <summary>
/// **WARNING**: this deprecated value is no longer exported since version 0.9.3 Replaced
/// by: `imageExportMode`
/// </summary>
[JsonPropertyName("exportPng")]
public bool? ExportPng { get; set; }
/// <summary>
/// If TRUE, a Tiled compatible file will also be generated along with the LDtk JSON file
/// (default is FALSE)
/// </summary>
[JsonPropertyName("exportTiled")]
public bool ExportTiled { get; set; }
/// <summary>
/// If TRUE, one file will be saved for the project (incl. all its definitions) and one file
/// in a sub-folder for each level.
/// </summary>
[JsonPropertyName("externalLevels")]
public bool ExternalLevels { get; set; }
/// <summary>
/// An array containing various advanced flags (ie. options or other states). Possible
/// values: `DiscardPreCsvIntGrid`, `ExportPreCsvIntGridFormat`, `IgnoreBackupSuggest`,
/// `PrependIndexToLevelFileNames`, `MultiWorlds`, `UseMultilinesType`
/// </summary>
[JsonPropertyName("flags")]
public Flag[] Flags { get; set; }
/// <summary>
/// Naming convention for Identifiers (first-letter uppercase, full uppercase etc.) Possible
/// values: `Capitalize`, `Uppercase`, `Lowercase`, `Free`
/// </summary>
[JsonPropertyName("identifierStyle")]
public IdentifierStyle IdentifierStyle { get; set; }
/// <summary>
/// "Image export" option when saving project. Possible values: `None`, `OneImagePerLayer`,
/// `OneImagePerLevel`, `LayersAndLevels`
/// </summary>
[JsonPropertyName("imageExportMode")]
public ImageExportMode ImageExportMode { get; set; }
/// <summary>
/// File format version
/// </summary>
[JsonPropertyName("jsonVersion")]
public string JsonVersion { get; set; }
/// <summary>
/// The default naming convention for level identifiers.
/// </summary>
[JsonPropertyName("levelNamePattern")]
public string LevelNamePattern { get; set; }
/// <summary>
/// All levels. The order of this array is only relevant in `LinearHorizontal` and
/// `linearVertical` world layouts (see `worldLayout` value).<br/> Otherwise, you should
/// refer to the `worldX`,`worldY` coordinates of each Level.
/// </summary>
[JsonPropertyName("levels")]
public Level[] Levels { get; set; }
/// <summary>
/// If TRUE, the Json is partially minified (no indentation, nor line breaks, default is
/// FALSE)
/// </summary>
[JsonPropertyName("minifyJson")]
public bool MinifyJson { get; set; }
/// <summary>
/// Next Unique integer ID available
/// </summary>
[JsonPropertyName("nextUid")]
public long NextUid { get; set; }
/// <summary>
/// File naming pattern for exported PNGs
/// </summary>
[JsonPropertyName("pngFilePattern")]
public string PngFilePattern { get; set; }
/// <summary>
/// If TRUE, a very simplified will be generated on saving, for quicker & easier engine
/// integration.
/// </summary>
[JsonPropertyName("simplifiedExport")]
public bool SimplifiedExport { get; set; }
/// <summary>
/// This optional description is used by LDtk Samples to show up some informations and
/// instructions.
/// </summary>
[JsonPropertyName("tutorialDesc")]
public string TutorialDesc { get; set; }
/// <summary>
/// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update.
/// It will then be `null`. You can enable the Multi-worlds advanced project option to enable
/// the change immediately.<br/><br/> Height of the world grid in pixels.
/// </summary>
[JsonPropertyName("worldGridHeight")]
public long? WorldGridHeight { get; set; }
/// <summary>
/// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update.
/// It will then be `null`. You can enable the Multi-worlds advanced project option to enable
/// the change immediately.<br/><br/> Width of the world grid in pixels.
/// </summary>
[JsonPropertyName("worldGridWidth")]
public long? WorldGridWidth { get; set; }
/// <summary>
/// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update.
/// It will then be `null`. You can enable the Multi-worlds advanced project option to enable
/// the change immediately.<br/><br/> An enum that describes how levels are organized in
/// this project (ie. linearly or in a 2D space). Possible values: <`null`>, `Free`,
/// `GridVania`, `LinearHorizontal`, `LinearVertical`
/// </summary>
[JsonPropertyName("worldLayout")]
public WorldLayout? WorldLayout { get; set; }
/// <summary>
/// This array is not used yet in current LDtk version (so, for now, it's always
/// empty).<br/><br/>In a later update, it will be possible to have multiple Worlds in a
/// single project, each containing multiple Levels.<br/><br/>What will change when "Multiple
/// worlds" support will be added to LDtk:<br/><br/> - in current version, a LDtk project
/// file can only contain a single world with multiple levels in it. In this case, levels and
/// world layout related settings are stored in the root of the JSON.<br/> - after the
/// "Multiple worlds" update, there will be a `worlds` array in root, each world containing
/// levels and layout settings. Basically, it's pretty much only about moving the `levels`
/// array to the `worlds` array, along with world layout related values (eg. `worldGridWidth`
/// etc).<br/><br/>If you want to start supporting this future update easily, please refer to
/// this documentation: https://github.com/deepnight/ldtk/issues/231
/// </summary>
[JsonPropertyName("worlds")]
public World[] Worlds { get; set; }
}
/// <summary>
/// If you're writing your own LDtk importer, you should probably just ignore *most* stuff in
/// the `defs` section, as it contains data that are mostly important to the editor. To keep
/// you away from the `defs` section and avoid some unnecessary JSON parsing, important data
/// from definitions is often duplicated in fields prefixed with a double underscore (eg.
/// `__identifier` or `__type`). The 2 only definition types you might need here are
/// **Tilesets** and **Enums**.
///
/// A structure containing all the definitions of this project
/// </summary>
public partial class Definitions
{
/// <summary>
/// All entities definitions, including their custom fields
/// </summary>
[JsonPropertyName("entities")]
public EntityDefinition[] Entities { get; set; }
/// <summary>
/// All internal enums
/// </summary>
[JsonPropertyName("enums")]
public EnumDefinition[] Enums { get; set; }
/// <summary>
/// Note: external enums are exactly the same as `enums`, except they have a `relPath` to
/// point to an external source file.
/// </summary>
[JsonPropertyName("externalEnums")]
public EnumDefinition[] ExternalEnums { get; set; }
/// <summary>
/// All layer definitions
/// </summary>
[JsonPropertyName("layers")]
public LayerDefinition[] Layers { get; set; }
/// <summary>
/// All custom fields available to all levels.
/// </summary>
[JsonPropertyName("levelFields")]
public FieldDefinition[] LevelFields { get; set; }
/// <summary>
/// All tilesets
/// </summary>
[JsonPropertyName("tilesets")]
public TilesetDefinition[] Tilesets { get; set; }
}
public partial class EntityDefinition
{
/// <summary>
/// Base entity color
/// </summary>
[JsonPropertyName("color")]
public string Color { get; set; }
/// <summary>
/// Array of field definitions
/// </summary>
[JsonPropertyName("fieldDefs")]
public FieldDefinition[] FieldDefs { get; set; }
[JsonPropertyName("fillOpacity")]
public double FillOpacity { get; set; }
/// <summary>
/// Pixel height
/// </summary>
[JsonPropertyName("height")]
public long Height { get; set; }
[JsonPropertyName("hollow")]
public bool Hollow { get; set; }
/// <summary>
/// User defined unique identifier
/// </summary>
[JsonPropertyName("identifier")]
public string Identifier { get; set; }
/// <summary>
/// Only applies to entities resizable on both X/Y. If TRUE, the entity instance width/height
/// will keep the same aspect ratio as the definition.
/// </summary>
[JsonPropertyName("keepAspectRatio")]
public bool KeepAspectRatio { get; set; }
/// <summary>
/// Possible values: `DiscardOldOnes`, `PreventAdding`, `MoveLastOne`
/// </summary>
[JsonPropertyName("limitBehavior")]
public LimitBehavior LimitBehavior { get; set; }
/// <summary>
/// If TRUE, the maxCount is a "per world" limit, if FALSE, it's a "per level". Possible
/// values: `PerLayer`, `PerLevel`, `PerWorld`
/// </summary>
[JsonPropertyName("limitScope")]
public LimitScope LimitScope { get; set; }
[JsonPropertyName("lineOpacity")]
public double LineOpacity { get; set; }
/// <summary>
/// Max instances count
/// </summary>
[JsonPropertyName("maxCount")]
public long MaxCount { get; set; }
/// <summary>
/// An array of 4 dimensions for the up/right/down/left borders (in this order) when using
/// 9-slice mode for `tileRenderMode`.<br/> If the tileRenderMode is not NineSlice, then
/// this array is empty.<br/> See: https://en.wikipedia.org/wiki/9-slice_scaling
/// </summary>
[JsonPropertyName("nineSliceBorders")]
public long[] NineSliceBorders { get; set; }
/// <summary>
/// Pivot X coordinate (from 0 to 1.0)
/// </summary>
[JsonPropertyName("pivotX")]
public double PivotX { get; set; }
/// <summary>
/// Pivot Y coordinate (from 0 to 1.0)
/// </summary>
[JsonPropertyName("pivotY")]
public double PivotY { get; set; }
/// <summary>
/// Possible values: `Rectangle`, `Ellipse`, `Tile`, `Cross`
/// </summary>
[JsonPropertyName("renderMode")]
public RenderMode RenderMode { get; set; }
/// <summary>
/// If TRUE, the entity instances will be resizable horizontally
/// </summary>
[JsonPropertyName("resizableX")]
public bool ResizableX { get; set; }
/// <summary>
/// If TRUE, the entity instances will be resizable vertically
/// </summary>
[JsonPropertyName("resizableY")]
public bool ResizableY { get; set; }
/// <summary>
/// Display entity name in editor
/// </summary>
[JsonPropertyName("showName")]
public bool ShowName { get; set; }
/// <summary>
/// An array of strings that classifies this entity
/// </summary>
[JsonPropertyName("tags")]
public string[] Tags { get; set; }
/// <summary>
/// **WARNING**: this deprecated value will be *removed* completely on version 1.2.0+
/// Replaced by: `tileRect`
/// </summary>
[JsonPropertyName("tileId")]
public long? TileId { get; set; }
[JsonPropertyName("tileOpacity")]
public double TileOpacity { get; set; }
/// <summary>
/// An object representing a rectangle from an existing Tileset
/// </summary>
[JsonPropertyName("tileRect")]
public TilesetRectangle TileRect { get; set; }
/// <summary>
/// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible
/// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`,
/// `FullSizeUncropped`, `NineSlice`
/// </summary>
[JsonPropertyName("tileRenderMode")]
public TileRenderMode TileRenderMode { get; set; }
/// <summary>
/// Tileset ID used for optional tile display
/// </summary>
[JsonPropertyName("tilesetId")]
public long? TilesetId { get; set; }
/// <summary>
/// Unique Int identifier
/// </summary>
[JsonPropertyName("uid")]
public long Uid { get; set; }
/// <summary>
/// Pixel width
/// </summary>
[JsonPropertyName("width")]
public long Width { get; set; }
}
/// <summary>
/// This section is mostly only intended for the LDtk editor app itself. You can safely
/// ignore it.
/// </summary>
public partial class FieldDefinition
{
/// <summary>
/// Human readable value type. Possible values: `Int, Float, String, Bool, Color,
/// ExternEnum.XXX, LocalEnum.XXX, Point, FilePath`.<br/> If the field is an array, this
/// field will look like `Array<...>` (eg. `Array<Int>`, `Array<Point>` etc.)<br/> NOTE: if
/// you enable the advanced option **Use Multilines type**, you will have "*Multilines*"
/// instead of "*String*" when relevant.
/// </summary>
[JsonPropertyName("__type")]
public string Type { get; set; }
/// <summary>
/// Optional list of accepted file extensions for FilePath value type. Includes the dot:
/// `.ext`
/// </summary>
[JsonPropertyName("acceptFileTypes")]
public string[] AcceptFileTypes { get; set; }
/// <summary>
/// Possible values: `Any`, `OnlySame`, `OnlyTags`
/// </summary>
[JsonPropertyName("allowedRefs")]
public AllowedRefs AllowedRefs { get; set; }
[JsonPropertyName("allowedRefTags")]
public string[] AllowedRefTags { get; set; }
[JsonPropertyName("allowOutOfLevelRef")]
public bool AllowOutOfLevelRef { get; set; }
/// <summary>
/// Array max length
/// </summary>
[JsonPropertyName("arrayMaxLength")]
public long? ArrayMaxLength { get; set; }
/// <summary>
/// Array min length
/// </summary>
[JsonPropertyName("arrayMinLength")]
public long? ArrayMinLength { get; set; }
[JsonPropertyName("autoChainRef")]
public bool AutoChainRef { get; set; }
/// <summary>
/// TRUE if the value can be null. For arrays, TRUE means it can contain null values
/// (exception: array of Points can't have null values).
/// </summary>
[JsonPropertyName("canBeNull")]
public bool CanBeNull { get; set; }
/// <summary>
/// Default value if selected value is null or invalid.
/// </summary>
[JsonPropertyName("defaultOverride")]
public object DefaultOverride { get; set; }
[JsonPropertyName("editorAlwaysShow")]
public bool EditorAlwaysShow { get; set; }
[JsonPropertyName("editorCutLongValues")]
public bool EditorCutLongValues { get; set; }
/// <summary>
/// Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `Points`,
/// `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`,
/// `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`,
/// `RefLinkBetweenCenters`
/// </summary>
[JsonPropertyName("editorDisplayMode")]
public EditorDisplayMode EditorDisplayMode { get; set; }
/// <summary>
/// Possible values: `Above`, `Center`, `Beneath`
/// </summary>
[JsonPropertyName("editorDisplayPos")]
public EditorDisplayPos EditorDisplayPos { get; set; }
[JsonPropertyName("editorTextPrefix")]
public string EditorTextPrefix { get; set; }
[JsonPropertyName("editorTextSuffix")]
public string EditorTextSuffix { get; set; }
/// <summary>
/// User defined unique identifier
/// </summary>
[JsonPropertyName("identifier")]
public string Identifier { get; set; }
/// <summary>
/// TRUE if the value is an array of multiple values
/// </summary>
[JsonPropertyName("isArray")]
public bool IsArray { get; set; }
/// <summary>
/// Max limit for value, if applicable
/// </summary>
[JsonPropertyName("max")]
public double? Max { get; set; }
/// <summary>
/// Min limit for value, if applicable
/// </summary>
[JsonPropertyName("min")]
public double? Min { get; set; }
/// <summary>
/// Optional regular expression that needs to be matched to accept values. Expected format:
/// `/some_reg_ex/g`, with optional "i" flag.
/// </summary>
[JsonPropertyName("regex")]
public string Regex { get; set; }
[JsonPropertyName("symmetricalRef")]
public bool SymmetricalRef { get; set; }
/// <summary>
/// Possible values: <`null`>, `LangPython`, `LangRuby`, `LangJS`, `LangLua`, `LangC`,
/// `LangHaxe`, `LangMarkdown`, `LangJson`, `LangXml`, `LangLog`
/// </summary>
[JsonPropertyName("textLanguageMode")]
public TextLanguageMode? TextLanguageMode { get; set; }
/// <summary>
/// UID of the tileset used for a Tile
/// </summary>
[JsonPropertyName("tilesetUid")]
public long? TilesetUid { get; set; }
/// <summary>
/// Internal enum representing the possible field types. Possible values: F_Int, F_Float,
/// F_String, F_Text, F_Bool, F_Color, F_Enum(...), F_Point, F_Path, F_EntityRef, F_Tile
/// </summary>
[JsonPropertyName("type")]
public string FieldDefinitionType { get; set; }
/// <summary>
/// Unique Int identifier
/// </summary>
[JsonPropertyName("uid")]
public long Uid { get; set; }
/// <summary>
/// If TRUE, the color associated with this field will override the Entity or Level default
/// color in the editor UI. For Enum fields, this would be the color associated to their
/// values.
/// </summary>
[JsonPropertyName("useForSmartColor")]
public bool UseForSmartColor { get; set; }
}
/// <summary>
/// This object represents a custom sub rectangle in a Tileset image.
/// </summary>
public partial class TilesetRectangle
{
/// <summary>
/// Height in pixels
/// </summary>
[JsonPropertyName("h")]
public long H { get; set; }
/// <summary>
/// UID of the tileset
/// </summary>
[JsonPropertyName("tilesetUid")]
public long TilesetUid { get; set; }
/// <summary>
/// Width in pixels
/// </summary>
[JsonPropertyName("w")]
public long W { get; set; }
/// <summary>
/// X pixels coordinate of the top-left corner in the Tileset image
/// </summary>
[JsonPropertyName("x")]
public long X { get; set; }
/// <summary>
/// Y pixels coordinate of the top-left corner in the Tileset image
/// </summary>
[JsonPropertyName("y")]
public long Y { get; set; }
}
public partial class EnumDefinition
{
[JsonPropertyName("externalFileChecksum")]
public string ExternalFileChecksum { get; set; }
/// <summary>
/// Relative path to the external file providing this Enum
/// </summary>
[JsonPropertyName("externalRelPath")]
public string ExternalRelPath { get; set; }
/// <summary>
/// Tileset UID if provided
/// </summary>
[JsonPropertyName("iconTilesetUid")]
public long? IconTilesetUid { get; set; }
/// <summary>
/// User defined unique identifier
/// </summary>
[JsonPropertyName("identifier")]
public string Identifier { get; set; }
/// <summary>
/// An array of user-defined tags to organize the Enums
/// </summary>
[JsonPropertyName("tags")]
public string[] Tags { get; set; }
/// <summary>
/// Unique Int identifier
/// </summary>
[JsonPropertyName("uid")]
public long Uid { get; set; }
/// <summary>
/// All possible enum values, with their optional Tile infos.
/// </summary>
[JsonPropertyName("values")]
public EnumValueDefinition[] Values { get; set; }
}
public partial class EnumValueDefinition
{
/// <summary>
/// An array of 4 Int values that refers to the tile in the tileset image: `[ x, y, width,
/// height ]`
/// </summary>
[JsonPropertyName("__tileSrcRect")]
public long[] TileSrcRect { get; set; }
/// <summary>
/// Optional color
/// </summary>
[JsonPropertyName("color")]
public long Color { get; set; }
/// <summary>
/// Enum value
/// </summary>
[JsonPropertyName("id")]
public string Id { get; set; }
/// <summary>
/// The optional ID of the tile
/// </summary>
[JsonPropertyName("tileId")]
public long? TileId { get; set; }
}
public partial class LayerDefinition
{
/// <summary>
/// Type of the layer (*IntGrid, Entities, Tiles or AutoLayer*)
/// </summary>
[JsonPropertyName("__type")]
public string Type { get; set; }
/// <summary>
/// Contains all the auto-layer rule definitions.
/// </summary>
[JsonPropertyName("autoRuleGroups")]
public AutoLayerRuleGroup[] AutoRuleGroups { get; set; }
[JsonPropertyName("autoSourceLayerDefUid")]
public long? AutoSourceLayerDefUid { get; set; }
/// <summary>
/// **WARNING**: this deprecated value will be *removed* completely on version 1.2.0+
/// Replaced by: `tilesetDefUid`
/// </summary>
[JsonPropertyName("autoTilesetDefUid")]
public long? AutoTilesetDefUid { get; set; }
/// <summary>
/// Opacity of the layer (0 to 1.0)
/// </summary>
[JsonPropertyName("displayOpacity")]
public double DisplayOpacity { get; set; }
/// <summary>
/// An array of tags to forbid some Entities in this layer
/// </summary>
[JsonPropertyName("excludedTags")]
public string[] ExcludedTags { get; set; }
/// <summary>
/// Width and height of the grid in pixels
/// </summary>
[JsonPropertyName("gridSize")]
public long GridSize { get; set; }
/// <summary>
/// Height of the optional "guide" grid in pixels
/// </summary>
[JsonPropertyName("guideGridHei")]
public long GuideGridHei { get; set; }
/// <summary>
/// Width of the optional "guide" grid in pixels
/// </summary>
[JsonPropertyName("guideGridWid")]
public long GuideGridWid { get; set; }
[JsonPropertyName("hideFieldsWhenInactive")]
public bool HideFieldsWhenInactive { get; set; }
/// <summary>
/// Hide the layer from the list on the side of the editor view.
/// </summary>
[JsonPropertyName("hideInList")]
public bool HideInList { get; set; }
/// <summary>
/// User defined unique identifier
/// </summary>
[JsonPropertyName("identifier")]
public string Identifier { get; set; }
/// <summary>
/// Alpha of this layer when it is not the active one.
/// </summary>
[JsonPropertyName("inactiveOpacity")]
public double InactiveOpacity { get; set; }
/// <summary>
/// An array that defines extra optional info for each IntGrid value.<br/> WARNING: the
/// array order is not related to actual IntGrid values! As user can re-order IntGrid values
/// freely, you may value "2" before value "1" in this array.
/// </summary>
[JsonPropertyName("intGridValues")]
public IntGridValueDefinition[] IntGridValues { get; set; }
/// <summary>
/// Parallax horizontal factor (from -1 to 1, defaults to 0) which affects the scrolling
/// speed of this layer, creating a fake 3D (parallax) effect.
/// </summary>
[JsonPropertyName("parallaxFactorX")]
public double ParallaxFactorX { get; set; }
/// <summary>
/// Parallax vertical factor (from -1 to 1, defaults to 0) which affects the scrolling speed
/// of this layer, creating a fake 3D (parallax) effect.
/// </summary>
[JsonPropertyName("parallaxFactorY")]
public double ParallaxFactorY { get; set; }
/// <summary>
/// If true (default), a layer with a parallax factor will also be scaled up/down accordingly.
/// </summary>
[JsonPropertyName("parallaxScaling")]
public bool ParallaxScaling { get; set; }
/// <summary>
/// X offset of the layer, in pixels (IMPORTANT: this should be added to the `LayerInstance`
/// optional offset)
/// </summary>
[JsonPropertyName("pxOffsetX")]
public long PxOffsetX { get; set; }
/// <summary>
/// Y offset of the layer, in pixels (IMPORTANT: this should be added to the `LayerInstance`
/// optional offset)
/// </summary>
[JsonPropertyName("pxOffsetY")]
public long PxOffsetY { get; set; }
/// <summary>
/// An array of tags to filter Entities that can be added to this layer
/// </summary>
[JsonPropertyName("requiredTags")]
public string[] RequiredTags { get; set; }
/// <summary>
/// If the tiles are smaller or larger than the layer grid, the pivot value will be used to
/// position the tile relatively its grid cell.
/// </summary>
[JsonPropertyName("tilePivotX")]
public double TilePivotX { get; set; }
/// <summary>
/// If the tiles are smaller or larger than the layer grid, the pivot value will be used to
/// position the tile relatively its grid cell.
/// </summary>
[JsonPropertyName("tilePivotY")]
public double TilePivotY { get; set; }
/// <summary>
/// Reference to the default Tileset UID being used by this layer definition.<br/>
/// **WARNING**: some layer *instances* might use a different tileset. So most of the time,
/// you should probably use the `__tilesetDefUid` value found in layer instances.<br/> Note:
/// since version 1.0.0, the old `autoTilesetDefUid` was removed and merged into this value.
/// </summary>
[JsonPropertyName("tilesetDefUid")]
public long? TilesetDefUid { get; set; }
/// <summary>
/// Type of the layer as Haxe Enum Possible values: `IntGrid`, `Entities`, `Tiles`,
/// `AutoLayer`
/// </summary>
[JsonPropertyName("type")]
public TypeEnum LayerDefinitionType { get; set; }
/// <summary>
/// Unique Int identifier
/// </summary>
[JsonPropertyName("uid")]
public long Uid { get; set; }
}
public partial class AutoLayerRuleGroup
{
[JsonPropertyName("active")]
public bool Active { get; set; }
/// <summary>
/// *This field was removed in 1.0.0 and should no longer be used.*
/// </summary>
[JsonPropertyName("collapsed")]
public bool? Collapsed { get; set; }
[JsonPropertyName("isOptional")]
public bool IsOptional { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("rules")]
public AutoLayerRuleDefinition[] Rules { get; set; }
[JsonPropertyName("uid")]
public long Uid { get; set; }
}
/// <summary>
/// This complex section isn't meant to be used by game devs at all, as these rules are
/// completely resolved internally by the editor before any saving. You should just ignore
/// this part.
/// </summary>
public partial class AutoLayerRuleDefinition
{
/// <summary>
/// If FALSE, the rule effect isn't applied, and no tiles are generated.
/// </summary>
[JsonPropertyName("active")]
public bool Active { get; set; }
/// <summary>
/// When TRUE, the rule will prevent other rules to be applied in the same cell if it matches
/// (TRUE by default).
/// </summary>
[JsonPropertyName("breakOnMatch")]
public bool BreakOnMatch { get; set; }
/// <summary>
/// Chances for this rule to be applied (0 to 1)
/// </summary>
[JsonPropertyName("chance")]
public double Chance { get; set; }
/// <summary>
/// Checker mode Possible values: `None`, `Horizontal`, `Vertical`
/// </summary>
[JsonPropertyName("checker")]
public Checker Checker { get; set; }
/// <summary>
/// If TRUE, allow rule to be matched by flipping its pattern horizontally
/// </summary>
[JsonPropertyName("flipX")]
public bool FlipX { get; set; }
/// <summary>
/// If TRUE, allow rule to be matched by flipping its pattern vertically
/// </summary>
[JsonPropertyName("flipY")]
public bool FlipY { get; set; }
/// <summary>
/// Default IntGrid value when checking cells outside of level bounds
/// </summary>
[JsonPropertyName("outOfBoundsValue")]
public long? OutOfBoundsValue { get; set; }
/// <summary>
/// Rule pattern (size x size)
/// </summary>
[JsonPropertyName("pattern")]
public long[] Pattern { get; set; }
/// <summary>
/// If TRUE, enable Perlin filtering to only apply rule on specific random area
/// </summary>
[JsonPropertyName("perlinActive")]
public bool PerlinActive { get; set; }
[JsonPropertyName("perlinOctaves")]
public double PerlinOctaves { get; set; }
[JsonPropertyName("perlinScale")]
public double PerlinScale { get; set; }
[JsonPropertyName("perlinSeed")]
public double PerlinSeed { get; set; }
/// <summary>
/// X pivot of a tile stamp (0-1)
/// </summary>
[JsonPropertyName("pivotX")]
public double PivotX { get; set; }
/// <summary>
/// Y pivot of a tile stamp (0-1)
/// </summary>
[JsonPropertyName("pivotY")]
public double PivotY { get; set; }
/// <summary>
/// Pattern width & height. Should only be 1,3,5 or 7.
/// </summary>
[JsonPropertyName("size")]
public long Size { get; set; }
/// <summary>
/// Array of all the tile IDs. They are used randomly or as stamps, based on `tileMode` value.
/// </summary>
[JsonPropertyName("tileIds")]
public long[] TileIds { get; set; }
/// <summary>
/// Defines how tileIds array is used Possible values: `Single`, `Stamp`
/// </summary>
[JsonPropertyName("tileMode")]
public TileMode TileMode { get; set; }