diff options
Diffstat (limited to 'src/defaultencyclopedia.rs')
| -rw-r--r-- | src/defaultencyclopedia.rs | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/src/defaultencyclopedia.rs b/src/defaultencyclopedia.rs new file mode 100644 index 0000000..bbc9d21 --- /dev/null +++ b/src/defaultencyclopedia.rs @@ -0,0 +1,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() +} |
