fix tests after The Big Entity Refactor

This commit is contained in:
Adam 2022-07-06 16:20:29 +02:00
parent 5a304245f1
commit 412cf15097
4 changed files with 398 additions and 132 deletions

View file

@ -25,12 +25,19 @@ class PrototypesTest : BehaviorSpec({
"prototypes": [ "prototypes": [
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "tile-unknown", "protoId": "tile/stone-path",
"order": "z-a", "order": "a[artificial]-a[tier-1]-a[stone-path]",
"layer": 0, "layer": 60,
"collisionMasks": {}, "collisionMasks": [
"mapColour": [0, 0, 0, 255], "ground-tile"
"canBeMined": false ],
"mapColour": [
86,
82,
74,
255
],
"canBeMined": true
} }
] ]
} }
@ -48,432 +55,619 @@ class PrototypesTest : BehaviorSpec({
// language=JSON // language=JSON
val raw = """ val raw = """
{ {
"modVersion": "0.3.2",
"tick": 534,
"data": { "data": {
"type": "kafkatorio.packet.instant.PrototypesUpdate",
"prototypes": [ "prototypes": [
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "stone-path", "protoId": "tile/stone-path",
"order": "a[artificial]-a[tier-1]-a[stone-path]", "order": "a[artificial]-a[tier-1]-a[stone-path]",
"layer": 60, "layer": 60,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [86, 82, 74, 255], "mapColour": [
86,
82,
74,
255
],
"canBeMined": true "canBeMined": true
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "concrete", "protoId": "tile/concrete",
"order": "a[artificial]-b[tier-2]-a[concrete]", "order": "a[artificial]-b[tier-2]-a[concrete]",
"layer": 61, "layer": 61,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [63, 61, 59, 255], "mapColour": [
63,
61,
59,
255
],
"canBeMined": true "canBeMined": true
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "hazard-concrete-left", "protoId": "tile/hazard-concrete-left",
"order": "a[artificial]-b[tier-2]-b[hazard-concrete-left]", "order": "a[artificial]-b[tier-2]-b[hazard-concrete-left]",
"layer": 62, "layer": 62,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [176, 142, 39, 255], "mapColour": [
176,
142,
39,
255
],
"canBeMined": true "canBeMined": true
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "hazard-concrete-right", "protoId": "tile/hazard-concrete-right",
"order": "a[artificial]-b[tier-2]-c[hazard-concrete-right]", "order": "a[artificial]-b[tier-2]-c[hazard-concrete-right]",
"layer": 62, "layer": 62,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [176, 142, 39, 255], "mapColour": [
176,
142,
39,
255
],
"canBeMined": true "canBeMined": true
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "refined-concrete", "protoId": "tile/refined-concrete",
"order": "a[artificial]-c[tier-3]-a[refined-concrete]", "order": "a[artificial]-c[tier-3]-a[refined-concrete]",
"layer": 64, "layer": 64,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [49, 48, 45, 255], "mapColour": [
49,
48,
45,
255
],
"canBeMined": true "canBeMined": true
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "refined-hazard-concrete-left", "protoId": "tile/refined-hazard-concrete-left",
"order": "a[artificial]-c[tier-3]-b[refined-hazard-concrete-left]", "order": "a[artificial]-c[tier-3]-b[refined-hazard-concrete-left]",
"layer": 65, "layer": 65,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [116, 94, 26, 255], "mapColour": [
116,
94,
26,
255
],
"canBeMined": true "canBeMined": true
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "refined-hazard-concrete-right", "protoId": "tile/refined-hazard-concrete-right",
"order": "a[artificial]-c[tier-3]-c[refined-hazard-concrete-right]", "order": "a[artificial]-c[tier-3]-c[refined-hazard-concrete-right]",
"layer": 65, "layer": 65,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [116, 94, 26, 255], "mapColour": [
116,
94,
26,
255
],
"canBeMined": true "canBeMined": true
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "landfill", "protoId": "tile/landfill",
"order": "a[artificial]-d[utility]-a[landfill]", "order": "a[artificial]-d[utility]-a[landfill]",
"layer": 57, "layer": 57,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [57, 39, 26, 255], "mapColour": [
57,
39,
26,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "acid-refined-concrete", "protoId": "tile/acid-refined-concrete",
"order": "a[artificial]-e[color-concrete]-acid", "order": "a[artificial]-e[color-concrete]-acid",
"layer": 97, "layer": 97,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [142, 194, 40, 127], "mapColour": [
142,
194,
40,
127
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "black-refined-concrete", "protoId": "tile/black-refined-concrete",
"order": "a[artificial]-e[color-concrete]-black", "order": "a[artificial]-e[color-concrete]-black",
"layer": 88, "layer": 88,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [25, 25, 25, 127], "mapColour": [
25,
25,
25,
127
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "blue-refined-concrete", "protoId": "tile/blue-refined-concrete",
"order": "a[artificial]-e[color-concrete]-blue", "order": "a[artificial]-e[color-concrete]-blue",
"layer": 73, "layer": 73,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [39, 137, 228, 127], "mapColour": [
39,
137,
228,
127
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "brown-refined-concrete", "protoId": "tile/brown-refined-concrete",
"order": "a[artificial]-e[color-concrete]-brown", "order": "a[artificial]-e[color-concrete]-brown",
"layer": 91, "layer": 91,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [76, 29, 0, 127], "mapColour": [
76,
29,
0,
127
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "cyan-refined-concrete", "protoId": "tile/cyan-refined-concrete",
"order": "a[artificial]-e[color-concrete]-cyan", "order": "a[artificial]-e[color-concrete]-cyan",
"layer": 94, "layer": 94,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [70, 192, 181, 127], "mapColour": [
70,
192,
181,
127
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "green-refined-concrete", "protoId": "tile/green-refined-concrete",
"order": "a[artificial]-e[color-concrete]-green", "order": "a[artificial]-e[color-concrete]-green",
"layer": 70, "layer": 70,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [23, 195, 43, 127], "mapColour": [
23,
195,
43,
127
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "orange-refined-concrete", "protoId": "tile/orange-refined-concrete",
"order": "a[artificial]-e[color-concrete]-orange", "order": "a[artificial]-e[color-concrete]-orange",
"layer": 76, "layer": 76,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [221, 127, 33, 127], "mapColour": [
221,
127,
33,
127
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "pink-refined-concrete", "protoId": "tile/pink-refined-concrete",
"order": "a[artificial]-e[color-concrete]-pink", "order": "a[artificial]-e[color-concrete]-pink",
"layer": 82, "layer": 82,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [236, 98, 131, 127], "mapColour": [
236,
98,
131,
127
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "purple-refined-concrete", "protoId": "tile/purple-refined-concrete",
"order": "a[artificial]-e[color-concrete]-purple", "order": "a[artificial]-e[color-concrete]-purple",
"layer": 85, "layer": 85,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [123, 28, 168, 127], "mapColour": [
123,
28,
168,
127
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "red-refined-concrete", "protoId": "tile/red-refined-concrete",
"order": "a[artificial]-e[color-concrete]-red", "order": "a[artificial]-e[color-concrete]-red",
"layer": 67, "layer": 67,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [207, 6, 0, 127], "mapColour": [
207,
6,
0,
127
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "yellow-refined-concrete", "protoId": "tile/yellow-refined-concrete",
"order": "a[artificial]-e[color-concrete]-yellow", "order": "a[artificial]-e[color-concrete]-yellow",
"layer": 79, "layer": 79,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [212, 169, 19, 127], "mapColour": [
212,
169,
19,
127
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "grass-1", "protoId": "tile/grass-1",
"order": "b[natural]-a[grass]-a[grass-1]", "order": "b[natural]-a[grass]-a[grass-1]",
"layer": 26, "layer": 26,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [55, 53, 11, 255], "mapColour": [
55,
53,
11,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "grass-2", "protoId": "tile/grass-2",
"order": "b[natural]-a[grass]-b[grass-2]", "order": "b[natural]-a[grass]-b[grass-2]",
"layer": 28, "layer": 28,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [66, 57, 15, 255], "mapColour": [
66,
57,
15,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "grass-3", "protoId": "tile/grass-3",
"order": "b[natural]-a[grass]-c[grass-3]", "order": "b[natural]-a[grass]-c[grass-3]",
"layer": 29, "layer": 29,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [65, 52, 28, 255], "mapColour": [
65,
52,
28,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "grass-4", "protoId": "tile/grass-4",
"order": "b[natural]-a[grass]-d[grass-4]", "order": "b[natural]-a[grass]-d[grass-4]",
"layer": 30, "layer": 30,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [59, 40, 18, 255], "mapColour": [
59,
40,
18,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "dry-dirt", "protoId": "tile/dry-dirt",
"order": "b[natural]-b[dirt]-a[dry-dirt]", "order": "b[natural]-b[dirt]-a[dry-dirt]",
"layer": 18, "layer": 18,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [94, 66, 37, 255], "mapColour": [
94,
66,
37,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "dirt-1", "protoId": "tile/dirt-1",
"order": "b[natural]-b[dirt]-b[dirt-1]", "order": "b[natural]-b[dirt]-b[dirt-1]",
"layer": 19, "layer": 19,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [141, 104, 60, 255], "mapColour": [
141,
104,
60,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "dirt-2", "protoId": "tile/dirt-2",
"order": "b[natural]-b[dirt]-c[dirt-2]", "order": "b[natural]-b[dirt]-c[dirt-2]",
"layer": 20, "layer": 20,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [136, 96, 59, 255], "mapColour": [
136,
96,
59,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "dirt-3", "protoId": "tile/dirt-3",
"order": "b[natural]-b[dirt]-d[dirt-3]", "order": "b[natural]-b[dirt]-d[dirt-3]",
"layer": 21, "layer": 21,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [133, 92, 53, 255], "mapColour": [
133,
92,
53,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "dirt-4", "protoId": "tile/dirt-4",
"order": "b[natural]-b[dirt]-e[dirt-4]", "order": "b[natural]-b[dirt]-e[dirt-4]",
"layer": 22, "layer": 22,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [103, 72, 43, 255], "mapColour": [
103,
72,
43,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "dirt-5", "protoId": "tile/dirt-5",
"order": "b[natural]-b[dirt]-f[dirt-5]", "order": "b[natural]-b[dirt]-f[dirt-5]",
"layer": 23, "layer": 23,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [91, 63, 38, 255], "mapColour": [
91,
63,
38,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "dirt-6", "protoId": "tile/dirt-6",
"order": "b[natural]-b[dirt]-g[dirt-6]", "order": "b[natural]-b[dirt]-g[dirt-6]",
"layer": 24, "layer": 24,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [80, 55, 31, 255], "mapColour": [
80,
55,
31,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "dirt-7", "protoId": "tile/dirt-7",
"order": "b[natural]-b[dirt]-h[dirt-7]", "order": "b[natural]-b[dirt]-h[dirt-7]",
"layer": 25, "layer": 25,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [80, 54, 28, 255], "mapColour": [
80,
54,
28,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "sand-1", "protoId": "tile/sand-1",
"order": "b[natural]-c[sand]-a[sand-1]", "order": "b[natural]-c[sand]-a[sand-1]",
"layer": 8, "layer": 8,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [138, 103, 58, 255], "mapColour": [
138,
103,
58,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "sand-2", "protoId": "tile/sand-2",
"order": "b[natural]-c[sand]-b[sand-2]", "order": "b[natural]-c[sand]-b[sand-2]",
"layer": 9, "layer": 9,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [128, 93, 52, 255], "mapColour": [
128,
93,
52,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "sand-3", "protoId": "tile/sand-3",
"order": "b[natural]-c[sand]-c[sand-3]", "order": "b[natural]-c[sand]-c[sand-3]",
"layer": 10, "layer": 10,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [115, 83, 47, 255], "mapColour": [
115,
83,
47,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "red-desert-0", "protoId": "tile/red-desert-0",
"order": "b[natural]-d[red-desert]-a[red-desert-0]", "order": "b[natural]-d[red-desert]-a[red-desert-0]",
"layer": 31, "layer": 31,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [103, 70, 32, 255], "mapColour": [
103,
70,
32,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "red-desert-1", "protoId": "tile/red-desert-1",
"order": "b[natural]-d[red-desert]-b[red-desert-1]", "order": "b[natural]-d[red-desert]-b[red-desert-1]",
"layer": 14, "layer": 14,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [116, 81, 39, 255], "mapColour": [
116,
81,
39,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "red-desert-2", "protoId": "tile/red-desert-2",
"order": "b[natural]-d[red-desert]-c[red-desert-2]", "order": "b[natural]-d[red-desert]-c[red-desert-2]",
"layer": 15, "layer": 15,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [116, 84, 43, 255], "mapColour": [
116,
84,
43,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "red-desert-3", "protoId": "tile/red-desert-3",
"order": "b[natural]-d[red-desert]-d[red-desert-3]", "order": "b[natural]-d[red-desert]-d[red-desert-3]",
"layer": 16, "layer": 16,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [128, 93, 52, 255], "mapColour": [
128,
93,
52,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "water", "protoId": "tile/water",
"order": "c[water]-a[water]", "order": "c[water]-a[water]",
"layer": 3, "layer": 3,
"collisionMasks": [ "collisionMasks": [
@ -483,12 +677,17 @@ class PrototypesTest : BehaviorSpec({
"resource-layer", "resource-layer",
"water-tile" "water-tile"
], ],
"mapColour": [51, 83, 95, 255], "mapColour": [
51,
83,
95,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "deepwater", "protoId": "tile/deepwater",
"order": "c[water]-b[deep-water]", "order": "c[water]-b[deep-water]",
"layer": 3, "layer": 3,
"collisionMasks": [ "collisionMasks": [
@ -498,12 +697,17 @@ class PrototypesTest : BehaviorSpec({
"resource-layer", "resource-layer",
"water-tile" "water-tile"
], ],
"mapColour": [38, 64, 73, 255], "mapColour": [
38,
64,
73,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "water-green", "protoId": "tile/water-green",
"order": "c[water]-c[water-green]", "order": "c[water]-c[water-green]",
"layer": 3, "layer": 3,
"collisionMasks": [ "collisionMasks": [
@ -513,12 +717,17 @@ class PrototypesTest : BehaviorSpec({
"resource-layer", "resource-layer",
"water-tile" "water-tile"
], ],
"mapColour": [31, 48, 18, 255], "mapColour": [
31,
48,
18,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "deepwater-green", "protoId": "tile/deepwater-green",
"order": "c[water]-d[deepwater-green]", "order": "c[water]-d[deepwater-green]",
"layer": 3, "layer": 3,
"collisionMasks": [ "collisionMasks": [
@ -528,12 +737,17 @@ class PrototypesTest : BehaviorSpec({
"resource-layer", "resource-layer",
"water-tile" "water-tile"
], ],
"mapColour": [23, 37, 16, 255], "mapColour": [
23,
37,
16,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "water-shallow", "protoId": "tile/water-shallow",
"order": "c[water]-e[water-shallow]", "order": "c[water]-e[water-shallow]",
"layer": 6, "layer": 6,
"collisionMasks": [ "collisionMasks": [
@ -542,12 +756,17 @@ class PrototypesTest : BehaviorSpec({
"resource-layer", "resource-layer",
"water-tile" "water-tile"
], ],
"mapColour": [82, 98, 92, 255], "mapColour": [
82,
98,
92,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "water-mud", "protoId": "tile/water-mud",
"order": "c[water]-g[water-mud]", "order": "c[water]-g[water-mud]",
"layer": 7, "layer": 7,
"collisionMasks": [ "collisionMasks": [
@ -556,23 +775,33 @@ class PrototypesTest : BehaviorSpec({
"resource-layer", "resource-layer",
"water-tile" "water-tile"
], ],
"mapColour": [65, 89, 90, 255], "mapColour": [
65,
89,
90,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "nuclear-ground", "protoId": "tile/nuclear-ground",
"order": "d[destruction]-a[nuclear]-a[nuclear-ground]", "order": "d[destruction]-a[nuclear]-a[nuclear-ground]",
"layer": 33, "layer": 33,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [48, 40, 35, 255], "mapColour": [
48,
40,
35,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "water-wube", "protoId": "tile/water-wube",
"order": "x[wube]-a[water-wube]", "order": "x[wube]-a[water-wube]",
"layer": 2, "layer": 2,
"collisionMasks": [ "collisionMasks": [
@ -582,22 +811,31 @@ class PrototypesTest : BehaviorSpec({
"resource-layer", "resource-layer",
"water-tile" "water-tile"
], ],
"mapColour": [0, 0, 0, 255], "mapColour": [
0,
0,
0,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "tile-unknown", "protoId": "tile/tile-unknown",
"order": "z-a", "order": "z-a",
"layer": 0, "layer": 0,
"collisionMasks": { "collisionMasks": {},
}, "mapColour": [
"mapColour": [0, 0, 0, 255], 0,
0,
0,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "out-of-map", "protoId": "tile/out-of-map",
"order": "z[other]-a[out-of-map]", "order": "z[other]-a[out-of-map]",
"layer": 0, "layer": 0,
"collisionMasks": [ "collisionMasks": [
@ -610,55 +848,83 @@ class PrototypesTest : BehaviorSpec({
"resource-layer", "resource-layer",
"water-tile" "water-tile"
], ],
"mapColour": [0, 0, 0, 255], "mapColour": [
0,
0,
0,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "lab-dark-1", "protoId": "tile/lab-dark-1",
"order": "z[other]-b[lab]-a[lab-dark-1]", "order": "z[other]-b[lab]-a[lab-dark-1]",
"layer": 70, "layer": 70,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [49, 49, 49, 255], "mapColour": [
49,
49,
49,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "lab-dark-2", "protoId": "tile/lab-dark-2",
"order": "z[other]-b[lab]-b[lab-dark-2]", "order": "z[other]-b[lab]-b[lab-dark-2]",
"layer": 70, "layer": 70,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [0, 0, 0, 255], "mapColour": [
0,
0,
0,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "lab-white", "protoId": "tile/lab-white",
"order": "z[other]-b[lab]-c[lab-white]", "order": "z[other]-b[lab]-c[lab-white]",
"layer": 70, "layer": 70,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [255, 255, 255, 255], "mapColour": [
255,
255,
255,
255
],
"canBeMined": false "canBeMined": false
}, },
{ {
"type": "kafkatorio.prototype.MapTile", "type": "kafkatorio.prototype.MapTile",
"name": "tutorial-grid", "protoId": "tile/tutorial-grid",
"order": "z[other]-c[tutorial]-a[tutorial-grid]", "order": "z[other]-c[tutorial]-a[tutorial-grid]",
"layer": 55, "layer": 55,
"collisionMasks": [ "collisionMasks": [
"ground-tile" "ground-tile"
], ],
"mapColour": [122, 122, 122, 255], "mapColour": [
122,
122,
122,
255
],
"canBeMined": false "canBeMined": false
} }
] ],
} "type": "kafkatorio.packet.instant.PrototypesUpdate"
},
"modVersion": "0.6.1",
"tick": 58468
} }
""".trimIndent() """.trimIndent()
@ -670,7 +936,7 @@ class PrototypesTest : BehaviorSpec({
.prototypes .prototypes
.forOne { .forOne {
it.shouldBeInstanceOf<FactorioPrototype.MapTile>() it.shouldBeInstanceOf<FactorioPrototype.MapTile>()
it.protoId shouldBe PrototypeId.MapTile("tutorial-grid") it.protoId shouldBe PrototypeId("tile", "tutorial-grid")
it.order shouldBe "z[other]-c[tutorial]-a[tutorial-grid]" it.order shouldBe "z[other]-c[tutorial]-a[tutorial-grid]"
it.layer shouldBe 55u it.layer shouldBe 55u
it.collisionMasks shouldBe listOf("ground-tile") it.collisionMasks shouldBe listOf("ground-tile")

View file

@ -191,7 +191,7 @@ class UpdatePacketsTest : FunSpec({
colour = null, colour = null,
diedCause = EntityIdentifiersData( diedCause = EntityIdentifiersData(
unitNumber = UnitNumber(66u), unitNumber = UnitNumber(66u),
protoId = PrototypeId("unit/small-biter"), protoId = PrototypeId("unit", "small-biter"),
), ),
disconnectReason = null, disconnectReason = null,
events = mapOf( events = mapOf(

View file

@ -116,11 +116,11 @@ class MapChunkPositionBoundsTest : FunSpec({
"44" to mapOf("1" to MapTileDictionary.PrototypeKey(44)), "44" to mapOf("1" to MapTileDictionary.PrototypeKey(44)),
), ),
protos = mapOf( protos = mapOf(
PrototypeName("water") to MapTileDictionary.PrototypeKey(1), PrototypeId("tile", "water") to MapTileDictionary.PrototypeKey(1),
PrototypeName("grass-4") to MapTileDictionary.PrototypeKey(2), PrototypeId("tile", "grass-4") to MapTileDictionary.PrototypeKey(2),
PrototypeName("grass-3") to MapTileDictionary.PrototypeKey(32), PrototypeId("tile", "grass-3") to MapTileDictionary.PrototypeKey(32),
PrototypeName("not-used") to MapTileDictionary.PrototypeKey(99), PrototypeId("tile", "not-used") to MapTileDictionary.PrototypeKey(99),
) )
) )

View file

@ -20,22 +20,22 @@ class MapTileDictionaryTest : FunSpec({
"44" to mapOf("1" to MapTileDictionary.PrototypeKey(44)), "44" to mapOf("1" to MapTileDictionary.PrototypeKey(44)),
), ),
protos = mapOf( protos = mapOf(
PrototypeId.MapTile("water") to MapTileDictionary.PrototypeKey(1), PrototypeId("tile", "water") to MapTileDictionary.PrototypeKey(1),
PrototypeId.MapTile("grass-4") to MapTileDictionary.PrototypeKey(2), PrototypeId("tile", "grass-4") to MapTileDictionary.PrototypeKey(2),
PrototypeId.MapTile("grass-3") to MapTileDictionary.PrototypeKey(32), PrototypeId("tile", "grass-3") to MapTileDictionary.PrototypeKey(32),
PrototypeId.MapTile("not-used") to MapTileDictionary.PrototypeKey(99), PrototypeId("tile", "not-used") to MapTileDictionary.PrototypeKey(99),
) )
) )
test("toMapTileList") { test("toMapTileList") {
actual.toMapTileList() shouldContainAll listOf( actual.toMapTileList() shouldContainAll listOf(
MapTile(-192, -65, PrototypeId.MapTile("grass-4")), MapTile(-192, -65, PrototypeId("tile", "grass-4")),
MapTile(161, -96, PrototypeId.MapTile("water")), MapTile(161, -96, PrototypeId("tile", "water")),
MapTile(161, -95, PrototypeId.MapTile("grass-4")), MapTile(161, -95, PrototypeId("tile", "grass-4")),
MapTile(161, 94, PrototypeId.MapTile("grass-4")), MapTile(161, 94, PrototypeId("tile", "grass-4")),
MapTile(161, 93, PrototypeId.MapTile("grass-3")), MapTile(161, 93, PrototypeId("tile", "grass-3")),
) )
} }
} }