Changes to API

Should make integration with game engines easier in general.

Puts the burden of color parsing on Pytiled. As well as formatting layer data into a two dimensional list from a straight one dimensional.
This commit is contained in:
Darren Eberly
2021-02-21 00:58:30 -05:00
parent ed825c5b71
commit 674b4b50c4
24 changed files with 700 additions and 738 deletions

View File

@@ -15,106 +15,115 @@ EXPECTED = tiled_map.TiledMap(
size=common_types.Size(10, 10),
id=1,
data=[
3,
3,
3,
3,
9,
9,
9,
9,
17,
17,
3,
3,
3,
9,
9,
9,
9,
17,
17,
17,
3,
3,
3,
9,
9,
9,
9,
9,
17,
17,
3,
3,
1,
7,
9,
9,
9,
15,
17,
17,
1,
1,
12,
5,
7,
7,
7,
15,
15,
15,
12,
1,
5,
5,
7,
7,
7,
15,
15,
15,
2,
2,
5,
5,
5,
5,
4,
14,
14,
14,
2,
2,
5,
5,
5,
4,
14,
14,
14,
14,
2,
2,
2,
5,
5,
5,
4,
14,
14,
14,
2,
2,
2,
2,
5,
5,
4,
4,
14,
14,
[
3,
3,
3,
3,
9,
9,
9,
9,
17,
17,
],
[
3,
3,
3,
9,
9,
9,
9,
17,
17,
17,
],
[
3,
3,
3,
9,
9,
9,
9,
9,
17,
17,
],
[3, 3, 1, 7, 9, 9, 9, 15, 17, 17],
[
1,
1,
12,
5,
7,
7,
7,
15,
15,
15,
],
[
12,
1,
5,
5,
7,
7,
7,
15,
15,
15,
],
[
2,
2,
5,
5,
5,
5,
4,
14,
14,
14,
],
[
2,
2,
5,
5,
5,
4,
14,
14,
14,
14,
],
[
2,
2,
2,
5,
5,
5,
4,
14,
14,
14,
],
[
2,
2,
2,
2,
5,
5,
4,
4,
14,
14,
],
],
)
],