-
Notifications
You must be signed in to change notification settings - Fork 3
/
tiled-tests.ts
110 lines (108 loc) · 2.36 KB
/
tiled-tests.ts
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
import TiledMap, { TiledLayerTilelayer } from "tiled-types";
const sampleOrthogonal: TiledMap = {
height: 20,
infinite: false,
compressionlevel: -1,
layers: [
{
data: [ 93, 93, 93, 93, 93, 93, 93 ],
height: 20,
id: 1,
name: "decors",
opacity: 1,
type: "tilelayer",
visible: true,
width: 20,
x: 0,
y: 0
},
{
data: 'foo-bar',
height: 20,
id: 2,
name: "obstacles",
opacity: 1,
type: "tilelayer",
visible: false,
width: 20,
x: 0,
y: 0
},
{
data: [ 0, 0, 0, 0, 0 ],
height: 20,
id: 3,
name: "init",
opacity: 1,
type: "tilelayer",
visible: true,
width: 20,
x: 0,
y: 0
}
],
nextlayerid: 4,
nextobjectid: 1,
orientation: "orthogonal",
renderorder: "left-up",
tiledversion: "1.2.4",
tileheight: 64,
tilesets: [
{
columns: 27,
firstgid: 1,
image: "map_2.png",
imageheight: 1280,
imagewidth: 1728,
margin: 0,
name: "map_main",
spacing: 0,
tilecount: 540,
tileheight: 64,
tilewidth: 64
}
],
tilewidth: 64,
type: "map",
version: 1.2,
width: 20,
properties: [
{
name: "azerty",
type: "color",
value: "#ffff5500"
},
{
name: "foo",
type: "string",
value: "bar"
},
{
name: "tata",
type: "float",
value: 8.89
},
{
name: "titi",
type: "file",
value: "Links.txt"
},
{
name: "toto",
type: "bool",
value: true
},
{
name: "tutu",
type: "int",
value: 8
},
{
name: "tyty",
type: "object",
value: 7
}
]
};
const allTilelayers: TiledLayerTilelayer[] = sampleOrthogonal.layers
.filter((l): l is TiledLayerTilelayer => l.type === 'tilelayer');