Skip to content

Commit

Permalink
test: tests from last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammin committed May 19, 2024
1 parent 76c1e9f commit 677d9ad
Show file tree
Hide file tree
Showing 4 changed files with 378 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Assets/Tests/EditMode/Tests/ComponentTilesetTilesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private static void TestTilesetTilePosition(LDtkComponentLayerTilesetTiles tiles

LDtkTilesetTile[] tiles = tilesComponent.GetTilesetTiles(pos);

Assert.IsTrue(tiles.Length == tilesComponent.Tilemaps.Count);
//Assert.IsTrue(tiles.Length == 2);

int notNullCount = tiles.Count(p => p != null);
Debug.Log($"\tGetTilesetTiles {tiles.Length}, where not-null count is {notNullCount}, expecting {assertTileCount}");
Expand Down
82 changes: 42 additions & 40 deletions Assets/Tests/Misc/OtherTechTests/Basic_Tileset_GridTiles.ldtk
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"doc": "https://ldtk.io/json",
"schema": "https://ldtk.io/files/JSON_SCHEMA.json",
"appAuthor": "Sebastien 'deepnight' Benard",
"appVersion": "1.5.2",
"appVersion": "1.5.3",
"url": "https://ldtk.io"
},
"iid": "55f99520-7820-11ed-ac9d-276850f51acc",
"jsonVersion": "1.5.2",
"appBuildId": 473624,
"jsonVersion": "1.5.3",
"appBuildId": 473703,
"nextUid": 11,
"identifierStyle": "Capitalize",
"toc": [],
Expand Down Expand Up @@ -39,7 +39,7 @@
"levelNamePattern": "%world_Level_%idx",
"tutorialDesc": "Meant to only contain nothing. No tile sets. We just want to gauge basic import capability",
"customCommands": [{
"command": "../../../../Library/LDtkTilesetExporter/ExportTilesetDefinition.exe Basic_Tileset_GridTiles",
"command": "../../../../Library/LDtkTilesetExporter/ExportTilesetDefinition.exe \"Basic_Tileset_GridTiles\"",
"when": "AfterSave"
}],
"flags": ["ExportOldTableOfContentData"],
Expand Down Expand Up @@ -85,7 +85,7 @@
"uid": 8,
"active": true,
"size": 3,
"tileRectsIds": [[213]],
"tileRectsIds": [[162]],
"alpha": 1,
"chance": 1,
"breakOnMatch": true,
Expand Down Expand Up @@ -235,24 +235,24 @@
{
"uid": 10,
"active": true,
"size": 3,
"size": 1,
"tileRectsIds": [[146]],
"alpha": 1,
"chance": 1,
"breakOnMatch": true,
"pattern": [0,0,0,1,1,0,0,0,0],
"pattern": [1],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"xOffset": 0,
"yOffset": 0,
"tileXOffset": 0,
"tileXOffset": 5,
"tileYOffset": 0,
"tileRandomXMin": 0,
"tileRandomXMax": 0,
"tileRandomYMin": 0,
"tileRandomYMax": 0,
"tileRandomXMin": -10,
"tileRandomXMax": 10,
"tileRandomYMin": -6,
"tileRandomYMax": 6,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
Expand Down Expand Up @@ -344,8 +344,8 @@
"worldX": 0,
"worldY": 0,
"worldDepth": 0,
"pxWid": 256,
"pxHei": 256,
"pxWid": 160,
"pxHei": 160,
"__bgColor": "#696A79",
"bgColor": null,
"useAutoIdentifier": true,
Expand All @@ -361,8 +361,8 @@
{
"__identifier": "AutoLayer",
"__type": "AutoLayer",
"__cWid": 16,
"__cHei": 16,
"__cWid": 10,
"__cHei": 10,
"__gridSize": 16,
"__opacity": 1,
"__pxTotalOffsetX": 0,
Expand All @@ -378,9 +378,8 @@
"optionalRules": [],
"intGridCsv": [],
"autoLayerTiles": [
{ "px": [48,112], "src": [96,144], "f": 0, "t": 213, "d": [8,115], "a": 1 },
{ "px": [96,112], "src": [96,144], "f": 0, "t": 213, "d": [8,118], "a": 1 },
{ "px": [48,128], "src": [96,144], "f": 0, "t": 213, "d": [8,131], "a": 1 }
{ "px": [32,32], "src": [16,112], "f": 0, "t": 162, "d": [8,22], "a": 1 },
{ "px": [48,80], "src": [16,112], "f": 0, "t": 162, "d": [8,53], "a": 1 }
],
"seed": 5734502,
"overrideTilesetUid": null,
Expand All @@ -390,8 +389,8 @@
{
"__identifier": "Tiles",
"__type": "Tiles",
"__cWid": 16,
"__cHei": 16,
"__cWid": 10,
"__cHei": 10,
"__gridSize": 16,
"__opacity": 1,
"__pxTotalOffsetX": 0,
Expand All @@ -410,18 +409,19 @@
"seed": 8173634,
"overrideTilesetUid": null,
"gridTiles": [
{ "px": [48,32], "src": [0,0], "f": 0, "t": 0, "d": [35], "a": 1 },
{ "px": [64,32], "src": [32,0], "f": 0, "t": 2, "d": [36], "a": 1 },
{ "px": [80,32], "src": [32,0], "f": 0, "t": 2, "d": [37], "a": 1 },
{ "px": [96,32], "src": [64,0], "f": 0, "t": 4, "d": [38], "a": 1 }
{ "px": [0,0], "src": [0,0], "f": 0, "t": 0, "d": [0], "a": 1 },
{ "px": [16,0], "src": [0,0], "f": 0, "t": 0, "d": [1], "a": 1 },
{ "px": [48,0], "src": [0,0], "f": 0, "t": 0, "d": [3], "a": 1 },
{ "px": [64,0], "src": [0,0], "f": 0, "t": 0, "d": [4], "a": 1 },
{ "px": [0,16], "src": [0,0], "f": 0, "t": 0, "d": [10], "a": 1 }
],
"entityInstances": []
},
{
"__identifier": "Entities",
"__type": "Entities",
"__cWid": 16,
"__cHei": 16,
"__cWid": 10,
"__cHei": 10,
"__gridSize": 16,
"__opacity": 1,
"__pxTotalOffsetX": 0,
Expand All @@ -445,8 +445,8 @@
{
"__identifier": "IntGrid",
"__type": "IntGrid",
"__cWid": 16,
"__cHei": 16,
"__cWid": 10,
"__cHei": 10,
"__gridSize": 16,
"__opacity": 1,
"__pxTotalOffsetX": 0,
Expand All @@ -461,19 +461,21 @@
"visible": true,
"optionalRules": [],
"intGridCsv": [
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,0,
0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
],
"autoLayerTiles": [
{ "px": [64,128], "src": [128,96], "f": 0, "t": 146, "d": [10,132], "a": 1 },
{ "px": [80,128], "src": [128,96], "f": 0, "t": 146, "d": [10,133], "a": 1 },
{ "px": [96,128], "src": [128,96], "f": 0, "t": 146, "d": [10,134], "a": 1 }
{ "px": [46,31], "src": [128,96], "f": 0, "t": 146, "d": [10,22], "a": 1 },
{ "px": [48,34], "src": [128,96], "f": 0, "t": 146, "d": [10,23], "a": 1 },
{ "px": [65,31], "src": [128,96], "f": 0, "t": 146, "d": [10,24], "a": 1 },
{ "px": [51,50], "src": [128,96], "f": 0, "t": 146, "d": [10,33], "a": 1 },
{ "px": [8,58], "src": [128,96], "f": 0, "t": 146, "d": [10,40], "a": 1 },
{ "px": [-3,83], "src": [128,96], "f": 0, "t": 146, "d": [10,50], "a": 1 },
{ "px": [11,75], "src": [128,96], "f": 0, "t": 146, "d": [10,51], "a": 1 },
{ "px": [61,82], "src": [128,96], "f": 0, "t": 146, "d": [10,53], "a": 1 },
{ "px": [5,99], "src": [128,96], "f": 0, "t": 146, "d": [10,60], "a": 1 },
{ "px": [0,116], "src": [128,96], "f": 0, "t": 146, "d": [10,70], "a": 1 }
],
"seed": 8985866,
"overrideTilesetUid": null,
Expand Down
Loading

0 comments on commit 677d9ad

Please sign in to comment.