Skip to content
Snippets Groups Projects
data_1_2_5.rs 55.7 KiB
Newer Older
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826
	#[serde(rename = "TilesetRect")]
	pub tileset_rect: Option<TilesetRectangle>,

	#[serde(rename = "World")]
	pub world: Option<World>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EntityInstance {
	/// Grid-based coordinates (`[x,y]` format)
	#[serde(rename = "__grid")]
	pub grid: Vec<i64>,

	/// Entity definition identifier
	#[serde(rename = "__identifier")]
	pub identifier: String,

	/// Pivot coordinates  (`[x,y]` format, values are from 0 to 1) of the Entity
	#[serde(rename = "__pivot")]
	pub pivot: Vec<f64>,

	/// The entity "smart" color, guessed from either Entity definition, or one its field
	/// instances.
	#[serde(rename = "__smartColor")]
	pub smart_color: String,

	/// Array of tags defined in this Entity definition
	#[serde(rename = "__tags")]
	pub tags: Vec<String>,

	/// Optional TilesetRect used to display this entity (it could either be the default Entity
	/// tile, or some tile provided by a field value, like an Enum).
	#[serde(rename = "__tile")]
	pub tile: Option<TilesetRectangle>,

	/// Reference of the **Entity definition** UID
	#[serde(rename = "defUid")]
	pub def_uid: i64,

	/// An array of all custom fields and their values.
	#[serde(rename = "fieldInstances")]
	pub field_instances: Vec<FieldInstance>,

	/// Entity height in pixels. For non-resizable entities, it will be the same as Entity
	/// definition.
	#[serde(rename = "height")]
	pub height: i64,

	/// Unique instance identifier
	#[serde(rename = "iid")]
	pub iid: String,

	/// Pixel coordinates (`[x,y]` format) in current level coordinate space. Don't forget
	/// optional layer offsets, if they exist!
	#[serde(rename = "px")]
	pub px: Vec<i64>,

	/// Entity width in pixels. For non-resizable entities, it will be the same as Entity
	/// definition.
	#[serde(rename = "width")]
	pub width: i64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FieldInstance {
	/// Field definition identifier
	#[serde(rename = "__identifier")]
	pub identifier: String,

	/// Optional TilesetRect used to display this field (this can be the field own Tile, or some
	/// other Tile guessed from the value, like an Enum).
	#[serde(rename = "__tile")]
	pub tile: Option<TilesetRectangle>,

	/// Type of the field, such as `Int`, `Float`, `String`, `Enum(my_enum_name)`, `Bool`,
	/// etc.<br/>  NOTE: if you enable the advanced option **Use Multilines type**, you will have
	/// "*Multilines*" instead of "*String*" when relevant.
	#[serde(rename = "__type")]
	pub field_instance_type: String,

	/// Actual value of the field instance. The value type varies, depending on `__type`:<br/>
	/// - For **classic types** (ie. Integer, Float, Boolean, String, Text and FilePath), you
	/// just get the actual value with the expected type.<br/>   - For **Color**, the value is an
	/// hexadecimal string using "#rrggbb" format.<br/>   - For **Enum**, the value is a String
	/// representing the selected enum value.<br/>   - For **Point**, the value is a
	/// [GridPoint](#ldtk-GridPoint) object.<br/>   - For **Tile**, the value is a
	/// [TilesetRect](#ldtk-TilesetRect) object.<br/>   - For **EntityRef**, the value is an
	/// [EntityReferenceInfos](#ldtk-EntityReferenceInfos) object.<br/><br/>  If the field is an
	/// array, then this `__value` will also be a JSON array.
	#[serde(rename = "__value")]
	pub value: Option<serde_json::Value>,

	/// Reference of the **Field definition** UID
	#[serde(rename = "defUid")]
	pub def_uid: i64,

	/// Editor internal raw values
	#[serde(rename = "realEditorValues")]
	pub real_editor_values: Vec<Option<serde_json::Value>>,
}

/// This object describes the "location" of an Entity instance in the project worlds.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ReferenceToAnEntityInstance {
	/// IID of the refered EntityInstance
	#[serde(rename = "entityIid")]
	pub entity_iid: String,

	/// IID of the LayerInstance containing the refered EntityInstance
	#[serde(rename = "layerIid")]
	pub layer_iid: String,

	/// IID of the Level containing the refered EntityInstance
	#[serde(rename = "levelIid")]
	pub level_iid: String,

	/// IID of the World containing the refered EntityInstance
	#[serde(rename = "worldIid")]
	pub world_iid: String,
}

/// This object is just a grid-based coordinate used in Field values.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GridPoint {
	/// X grid-based coordinate
	#[serde(rename = "cx")]
	pub cx: i64,

	/// Y grid-based coordinate
	#[serde(rename = "cy")]
	pub cy: i64,
}

/// IntGrid value instance
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IntGridValueInstance {
	/// Coordinate ID in the layer grid
	#[serde(rename = "coordId")]
	pub coord_id: i64,

	/// IntGrid value
	#[serde(rename = "v")]
	pub v: i64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LayerInstance {
	/// Grid-based height
	#[serde(rename = "__cHei")]
	pub c_hei: i64,

	/// Grid-based width
	#[serde(rename = "__cWid")]
	pub c_wid: i64,

	/// Grid size
	#[serde(rename = "__gridSize")]
	pub grid_size: i64,

	/// Layer definition identifier
	#[serde(rename = "__identifier")]
	pub identifier: String,

	/// Layer opacity as Float [0-1]
	#[serde(rename = "__opacity")]
	pub opacity: f64,

	/// Total layer X pixel offset, including both instance and definition offsets.
	#[serde(rename = "__pxTotalOffsetX")]
	pub px_total_offset_x: i64,

	/// Total layer Y pixel offset, including both instance and definition offsets.
	#[serde(rename = "__pxTotalOffsetY")]
	pub px_total_offset_y: i64,

	/// The definition UID of corresponding Tileset, if any.
	#[serde(rename = "__tilesetDefUid")]
	pub tileset_def_uid: Option<i64>,

	/// The relative path to corresponding Tileset, if any.
	#[serde(rename = "__tilesetRelPath")]
	pub tileset_rel_path: Option<String>,

	/// Layer type (possible values: IntGrid, Entities, Tiles or AutoLayer)
	#[serde(rename = "__type")]
	pub layer_instance_type: String,

	/// An array containing all tiles generated by Auto-layer rules. The array is already sorted
	/// in display order (ie. 1st tile is beneath 2nd, which is beneath 3rd etc.).<br/><br/>
	/// Note: if multiple tiles are stacked in the same cell as the result of different rules,
	/// all tiles behind opaque ones will be discarded.
	#[serde(rename = "autoLayerTiles")]
	pub auto_layer_tiles: Vec<TileInstance>,

	#[serde(rename = "entityInstances")]
	pub entity_instances: Vec<EntityInstance>,

	#[serde(rename = "gridTiles")]
	pub grid_tiles: Vec<TileInstance>,

	/// Unique layer instance identifier
	#[serde(rename = "iid")]
	pub iid: String,

	/// **WARNING**: this deprecated value is no longer exported since version 1.0.0  Replaced
	/// by: `intGridCsv`
	#[serde(rename = "intGrid")]
	pub int_grid: Option<Vec<IntGridValueInstance>>,

	/// A list of all values in the IntGrid layer, stored in CSV format (Comma Separated
	/// Values).<br/>  Order is from left to right, and top to bottom (ie. first row from left to
	/// right, followed by second row, etc).<br/>  `0` means "empty cell" and IntGrid values
	/// start at 1.<br/>  The array size is `__cWid` x `__cHei` cells.
	#[serde(rename = "intGridCsv")]
	pub int_grid_csv: Vec<i64>,

	/// Reference the Layer definition UID
	#[serde(rename = "layerDefUid")]
	pub layer_def_uid: i64,

	/// Reference to the UID of the level containing this layer instance
	#[serde(rename = "levelId")]
	pub level_id: i64,

	/// An Array containing the UIDs of optional rules that were enabled in this specific layer
	/// instance.
	#[serde(rename = "optionalRules")]
	pub optional_rules: Vec<i64>,

	/// This layer can use another tileset by overriding the tileset UID here.
	#[serde(rename = "overrideTilesetUid")]
	pub override_tileset_uid: Option<i64>,

	/// X offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to
	/// the `LayerDef` optional offset, so you should probably prefer using `__pxTotalOffsetX`
	/// which contains the total offset value)
	#[serde(rename = "pxOffsetX")]
	pub px_offset_x: i64,

	/// Y offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to
	/// the `LayerDef` optional offset, so you should probably prefer using `__pxTotalOffsetX`
	/// which contains the total offset value)
	#[serde(rename = "pxOffsetY")]
	pub px_offset_y: i64,

	/// Random seed used for Auto-Layers rendering
	#[serde(rename = "seed")]
	pub seed: i64,

	/// Layer instance visibility
	#[serde(rename = "visible")]
	pub visible: bool,
}

/// This structure represents a single tile from a given Tileset.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TileInstance {
	/// Internal data used by the editor.<br/>  For auto-layer tiles: `[ruleId, coordId]`.<br/>
	/// For tile-layer tiles: `[coordId]`.
	#[serde(rename = "d")]
	pub d: Vec<i64>,

	/// "Flip bits", a 2-bits integer to represent the mirror transformations of the tile.<br/>
	/// - Bit 0 = X flip<br/>   - Bit 1 = Y flip<br/>   Examples: f=0 (no flip), f=1 (X flip
	/// only), f=2 (Y flip only), f=3 (both flips)
	#[serde(rename = "f")]
	pub f: i64,

	/// Pixel coordinates of the tile in the **layer** (`[x,y]` format). Don't forget optional
	/// layer offsets, if they exist!
	#[serde(rename = "px")]
	pub px: Vec<i64>,

	/// Pixel coordinates of the tile in the **tileset** (`[x,y]` format)
	#[serde(rename = "src")]
	pub src: Vec<i64>,

	/// The *Tile ID* in the corresponding tileset.
	#[serde(rename = "t")]
	pub t: i64,
}

/// This section contains all the level data. It can be found in 2 distinct forms, depending
/// on Project current settings:  - If "*Separate level files*" is **disabled** (default):
/// full level data is *embedded* inside the main Project JSON file, - If "*Separate level
/// files*" is **enabled**: level data is stored in *separate* standalone `.ldtkl` files (one
/// per level). In this case, the main Project JSON file will still contain most level data,
/// except heavy sections, like the `layerInstances` array (which will be null). The
/// `externalRelPath` string points to the `ldtkl` file.  A `ldtkl` file is just a JSON file
/// containing exactly what is described below.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Level {
	/// Background color of the level (same as `bgColor`, except the default value is
	/// automatically used here if its value is `null`)
	#[serde(rename = "__bgColor")]
	pub bg_color: String,

	/// Position informations of the background image, if there is one.
	#[serde(rename = "__bgPos")]
	pub bg_pos: Option<LevelBackgroundPosition>,

	/// An array listing all other levels touching this one on the world map.<br/>  Only relevant
	/// for world layouts where level spatial positioning is manual (ie. GridVania, Free). For
	/// Horizontal and Vertical layouts, this array is always empty.
	#[serde(rename = "__neighbours")]
	pub neighbours: Vec<NeighbourLevel>,

	/// The "guessed" color for this level in the editor, decided using either the background
	/// color or an existing custom field.
	#[serde(rename = "__smartColor")]
	pub smart_color: String,

	/// Background color of the level. If `null`, the project `defaultLevelBgColor` should be
	/// used.
	#[serde(rename = "bgColor")]
	pub level_bg_color: Option<String>,

	/// Background image X pivot (0-1)
	#[serde(rename = "bgPivotX")]
	pub bg_pivot_x: f64,

	/// Background image Y pivot (0-1)
	#[serde(rename = "bgPivotY")]
	pub bg_pivot_y: f64,

	/// An enum defining the way the background image (if any) is positioned on the level. See
	/// `__bgPos` for resulting position info. Possible values: &lt;`null`&gt;, `Unscaled`,
	/// `Contain`, `Cover`, `CoverDirty`
	#[serde(rename = "bgPos")]
	pub level_bg_pos: Option<BgPos>,

	/// The *optional* relative path to the level background image.
	#[serde(rename = "bgRelPath")]
	pub bg_rel_path: Option<String>,

	/// This value is not null if the project option "*Save levels separately*" is enabled. In
	/// this case, this **relative** path points to the level Json file.
	#[serde(rename = "externalRelPath")]
	pub external_rel_path: Option<String>,

	/// An array containing this level custom field values.
	#[serde(rename = "fieldInstances")]
	pub field_instances: Vec<FieldInstance>,

	/// User defined unique identifier
	#[serde(rename = "identifier")]
	pub identifier: String,

	/// Unique instance identifier
	#[serde(rename = "iid")]
	pub iid: String,

	/// An array containing all Layer instances. **IMPORTANT**: if the project option "*Save
	/// levels separately*" is enabled, this field will be `null`.<br/>  This array is **sorted
	/// in display order**: the 1st layer is the top-most and the last is behind.
	#[serde(rename = "layerInstances")]
	pub layer_instances: Option<Vec<LayerInstance>>,

	/// Height of the level in pixels
	#[serde(rename = "pxHei")]
	pub px_hei: i64,

	/// Width of the level in pixels
	#[serde(rename = "pxWid")]
	pub px_wid: i64,

	/// Unique Int identifier
	#[serde(rename = "uid")]
	pub uid: i64,

	/// If TRUE, the level identifier will always automatically use the naming pattern as defined
	/// in `Project.levelNamePattern`. Becomes FALSE if the identifier is manually modified by
	/// user.
	#[serde(rename = "useAutoIdentifier")]
	pub use_auto_identifier: bool,

	/// Index that represents the "depth" of the level in the world. Default is 0, greater means
	/// "above", lower means "below".<br/>  This value is mostly used for display only and is
	/// intended to make stacking of levels easier to manage.
	#[serde(rename = "worldDepth")]
	pub world_depth: i64,

	/// World X coordinate in pixels.<br/>  Only relevant for world layouts where level spatial
	/// positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, the
	/// value is always -1 here.
	#[serde(rename = "worldX")]
	pub world_x: i64,

	/// World Y coordinate in pixels.<br/>  Only relevant for world layouts where level spatial
	/// positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, the
	/// value is always -1 here.
	#[serde(rename = "worldY")]
	pub world_y: i64,
}

/// Level background image position info
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LevelBackgroundPosition {
	/// An array of 4 float values describing the cropped sub-rectangle of the displayed
	/// background image. This cropping happens when original is larger than the level bounds.
	/// Array format: `[ cropX, cropY, cropWidth, cropHeight ]`
	#[serde(rename = "cropRect")]
	pub crop_rect: Vec<f64>,

	/// An array containing the `[scaleX,scaleY]` values of the **cropped** background image,
	/// depending on `bgPos` option.
	#[serde(rename = "scale")]
	pub scale: Vec<f64>,

	/// An array containing the `[x,y]` pixel coordinates of the top-left corner of the
	/// **cropped** background image, depending on `bgPos` option.
	#[serde(rename = "topLeftPx")]
	pub top_left_px: Vec<i64>,
}

/// Nearby level info
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NeighbourLevel {
	/// A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est,
	/// `e`ast).
	#[serde(rename = "dir")]
	pub dir: String,

	/// Neighbour Instance Identifier
	#[serde(rename = "levelIid")]
	pub level_iid: String,

	/// **WARNING**: this deprecated value is no longer exported since version 1.2.0  Replaced
	/// by: `levelIid`
	#[serde(rename = "levelUid")]
	pub level_uid: Option<i64>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LdtkTableOfContentEntry {
	#[serde(rename = "identifier")]
	pub identifier: String,

	#[serde(rename = "instances")]
	pub instances: Vec<ReferenceToAnEntityInstance>,
}

/// **IMPORTANT**: this type is not used *yet* in current LDtk version. It's only presented
/// here as a preview of a planned feature.  A World contains multiple levels, and it has its
/// own layout settings.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct World {
	/// Default new level height
	#[serde(rename = "defaultLevelHeight")]
	pub default_level_height: i64,

	/// Default new level width
	#[serde(rename = "defaultLevelWidth")]
	pub default_level_width: i64,

	/// User defined unique identifier
	#[serde(rename = "identifier")]
	pub identifier: String,

	/// Unique instance identifer
	#[serde(rename = "iid")]
	pub iid: String,

	/// All levels from this world. The order of this array is only relevant in
	/// `LinearHorizontal` and `linearVertical` world layouts (see `worldLayout` value).
	/// Otherwise, you should refer to the `worldX`,`worldY` coordinates of each Level.
	#[serde(rename = "levels")]
	pub levels: Vec<Level>,

	/// Height of the world grid in pixels.
	#[serde(rename = "worldGridHeight")]
	pub world_grid_height: i64,

	/// Width of the world grid in pixels.
	#[serde(rename = "worldGridWidth")]
	pub world_grid_width: i64,

	/// An enum that describes how levels are organized in this project (ie. linearly or in a 2D
	/// space). Possible values: `Free`, `GridVania`, `LinearHorizontal`, `LinearVertical`, `null`
	#[serde(rename = "worldLayout")]
	pub world_layout: Option<WorldLayout>,
}

/// Possible values: `Manual`, `AfterLoad`, `BeforeSave`, `AfterSave`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum When {
	#[serde(rename = "AfterLoad")]
	AfterLoad,

	#[serde(rename = "AfterSave")]
	AfterSave,

	#[serde(rename = "BeforeSave")]
	BeforeSave,

	#[serde(rename = "Manual")]
	Manual,
}

/// Possible values: `Any`, `OnlySame`, `OnlyTags`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum AllowedRefs {
	#[serde(rename = "Any")]
	Any,

	#[serde(rename = "OnlySame")]
	OnlySame,

	#[serde(rename = "OnlyTags")]
	OnlyTags,
}

/// Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `Points`,
/// `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`,
/// `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`,
/// `RefLinkBetweenCenters`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum EditorDisplayMode {
	#[serde(rename = "ArrayCountNoLabel")]
	ArrayCountNoLabel,

	#[serde(rename = "ArrayCountWithLabel")]
	ArrayCountWithLabel,

	#[serde(rename = "EntityTile")]
	EntityTile,

	#[serde(rename = "Hidden")]
	Hidden,

	#[serde(rename = "NameAndValue")]
	NameAndValue,

	#[serde(rename = "PointPath")]
	PointPath,

	#[serde(rename = "PointPathLoop")]
	PointPathLoop,

	#[serde(rename = "PointStar")]
	PointStar,

	#[serde(rename = "Points")]
	Points,

	#[serde(rename = "RadiusGrid")]
	RadiusGrid,

	#[serde(rename = "RadiusPx")]
	RadiusPx,

	#[serde(rename = "RefLinkBetweenCenters")]
	RefLinkBetweenCenters,

	#[serde(rename = "RefLinkBetweenPivots")]
	RefLinkBetweenPivots,

	#[serde(rename = "ValueOnly")]
	ValueOnly,
}

/// Possible values: `Above`, `Center`, `Beneath`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum EditorDisplayPos {
	#[serde(rename = "Above")]
	Above,

	#[serde(rename = "Beneath")]
	Beneath,

	#[serde(rename = "Center")]
	Center,
}

/// Possible values: `ZigZag`, `StraightArrow`, `CurvedArrow`, `ArrowsLine`, `DashedLine`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum EditorLinkStyle {
	#[serde(rename = "ArrowsLine")]
	ArrowsLine,

	#[serde(rename = "CurvedArrow")]
	CurvedArrow,

	#[serde(rename = "DashedLine")]
	DashedLine,

	#[serde(rename = "StraightArrow")]
	StraightArrow,

	#[serde(rename = "ZigZag")]
	ZigZag,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum TextLanguageMode {
	#[serde(rename = "LangC")]
	LangC,

	#[serde(rename = "LangHaxe")]
	LangHaxe,

	#[serde(rename = "LangJS")]
	LangJs,

	#[serde(rename = "LangJson")]
	LangJson,

	#[serde(rename = "LangLog")]
	LangLog,

	#[serde(rename = "LangLua")]
	LangLua,

	#[serde(rename = "LangMarkdown")]
	LangMarkdown,

	#[serde(rename = "LangPython")]
	LangPython,

	#[serde(rename = "LangRuby")]
	LangRuby,

	#[serde(rename = "LangXml")]
	LangXml,
}

/// Possible values: `DiscardOldOnes`, `PreventAdding`, `MoveLastOne`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum LimitBehavior {
	#[serde(rename = "DiscardOldOnes")]
	DiscardOldOnes,

	#[serde(rename = "MoveLastOne")]
	MoveLastOne,

	#[serde(rename = "PreventAdding")]
	PreventAdding,
}

/// If TRUE, the maxCount is a "per world" limit, if FALSE, it's a "per level". Possible
/// values: `PerLayer`, `PerLevel`, `PerWorld`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum LimitScope {
	#[serde(rename = "PerLayer")]
	PerLayer,

	#[serde(rename = "PerLevel")]
	PerLevel,

	#[serde(rename = "PerWorld")]
	PerWorld,
}

/// Possible values: `Rectangle`, `Ellipse`, `Tile`, `Cross`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum RenderMode {
	#[serde(rename = "Cross")]
	Cross,

	#[serde(rename = "Ellipse")]
	Ellipse,

	#[serde(rename = "Rectangle")]
	Rectangle,

	#[serde(rename = "Tile")]
	Tile,
}

/// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible
/// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`,
/// `FullSizeUncropped`, `NineSlice`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum TileRenderMode {
	#[serde(rename = "Cover")]
	Cover,

	#[serde(rename = "FitInside")]
	FitInside,

	#[serde(rename = "FullSizeCropped")]
	FullSizeCropped,

	#[serde(rename = "FullSizeUncropped")]
	FullSizeUncropped,

	#[serde(rename = "NineSlice")]
	NineSlice,

	#[serde(rename = "Repeat")]
	Repeat,

	#[serde(rename = "Stretch")]
	Stretch,
}

/// Checker mode Possible values: `None`, `Horizontal`, `Vertical`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum Checker {
	#[serde(rename = "Horizontal")]
	Horizontal,

	#[serde(rename = "None")]
	None,

	#[serde(rename = "Vertical")]
	Vertical,
}

/// Defines how tileIds array is used Possible values: `Single`, `Stamp`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum TileMode {
	#[serde(rename = "Single")]
	Single,

	#[serde(rename = "Stamp")]
	Stamp,
}

/// Type of the layer as Haxe Enum Possible values: `IntGrid`, `Entities`, `Tiles`,
/// `AutoLayer`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum Type {
	#[serde(rename = "AutoLayer")]
	AutoLayer,

	#[serde(rename = "Entities")]
	Entities,

	#[serde(rename = "IntGrid")]
	IntGrid,

	#[serde(rename = "Tiles")]
	Tiles,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum EmbedAtlas {
	#[serde(rename = "LdtkIcons")]
	LdtkIcons,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum Flag {
	#[serde(rename = "DiscardPreCsvIntGrid")]
	DiscardPreCsvIntGrid,

	#[serde(rename = "ExportPreCsvIntGridFormat")]
	ExportPreCsvIntGridFormat,

	#[serde(rename = "IgnoreBackupSuggest")]
	IgnoreBackupSuggest,

	#[serde(rename = "MultiWorlds")]
	MultiWorlds,

	#[serde(rename = "PrependIndexToLevelFileNames")]
	PrependIndexToLevelFileNames,

	#[serde(rename = "UseMultilinesType")]
	UseMultilinesType,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum BgPos {
	#[serde(rename = "Contain")]
	Contain,

	#[serde(rename = "Cover")]
	Cover,

	#[serde(rename = "CoverDirty")]
	CoverDirty,

	#[serde(rename = "Unscaled")]
	Unscaled,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum WorldLayout {
	#[serde(rename = "Free")]
	Free,

	#[serde(rename = "GridVania")]
	GridVania,

	#[serde(rename = "LinearHorizontal")]
	LinearHorizontal,

	#[serde(rename = "LinearVertical")]
	LinearVertical,
}

/// Naming convention for Identifiers (first-letter uppercase, full uppercase etc.) Possible
/// values: `Capitalize`, `Uppercase`, `Lowercase`, `Free`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum IdentifierStyle {
	#[serde(rename = "Capitalize")]
	Capitalize,

	#[serde(rename = "Free")]
	Free,

	#[serde(rename = "Lowercase")]
	Lowercase,

	#[serde(rename = "Uppercase")]
	Uppercase,
}

/// "Image export" option when saving project. Possible values: `None`, `OneImagePerLayer`,
/// `OneImagePerLevel`, `LayersAndLevels`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum ImageExportMode {
	#[serde(rename = "LayersAndLevels")]
	LayersAndLevels,

	#[serde(rename = "None")]
	None,

	#[serde(rename = "OneImagePerLayer")]
	OneImagePerLayer,

	#[serde(rename = "OneImagePerLevel")]
	OneImagePerLevel,
}