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
|
use crate::encyclopedia::Encyclopedia;
use serde_json::json;
pub fn default_encyclopedia() -> Encyclopedia {
Encyclopedia::from_json(json!({
"wall": {
"components": ["Blocking"],
"sprite": "wall",
"height": 2
},
"rock": {
"components": ["Blocking"],
"sprite": "rock",
"height": 10
},
"tree": {
"components": ["Blocking"],
"sprite": "tree",
"height": 3
},
"fence": {
"components": ["Blocking"],
"sprite": "fence",
"height": 1
},
"grass": {
"components": [
["Visible", {
"sprite": ["random", [
["string", "grass1"],
["string", "grass2"],
["string", "grass3"],
["string", "grass1"],
["string", "grass2"],
["string", "grass3"],
["string", "ground"]
]],
"height": ["float", 0.1]
}],
"Floor"
]
},
"greengrass": {
"components": [
["Visible", {
"sprite": ["random", [
["string", "grass1"],
["string", "grass2"],
["string", "grass3"]
]],
"height": ["float", 0.1]
}],
"Floor"
]
},
"ground": {
"components": ["Floor"],
"sprite": "ground",
"height": 0.1
},
"floor": {
"components": ["Floor"],
"sprite": "floor",
"height": 0.1
},
"bridge": {
"components": [
"Floor"
],
"sprite": "bridge",
"height": 0.1
},
"water": {
"components": [],
"sprite": "water",
"height": 0.1
},
"pebble": {
"components": [
["Item", {"ent": ["template", "pebble"], "name": ["string", "pebble"]}]
],
"sprite": "pebble",
"height": 0.4
},
"player": {
"arguments": [["name", "string", null]],
"components": [
["Visible", {
"sprite": ["string", "player"],
"height": ["float", 1.0]
}],
["Player", {
"name": ["arg", "name"]
}],
["Inventory", {"capacity": ["int", 3]}],
["Health", {"health": ["int", 9], "maxhealth": ["int", 10]}]
]
}
})).unwrap()
}
|