-
Notifications
You must be signed in to change notification settings - Fork 10
json
selfsame edited this page Jan 7, 2015
·
7 revisions
Entities are loaded from .json files in mud/game/.
Each file holds one entity.
The format of the data is a map(dict) of component name to component data
{"id": "rat",
"living": {"hpmax": 12},
"mamal": true,
"weight": 1.2}
The only required component is the 'id', which should have a unique string value.
The 'extends' component is a list of id strings of other entities that are merged into the new entity.
{"id": "mouse",
"extends": ["mammal", "rodent"],
"plural": "mice",
"living": {"hpmax": "2d4"},
"weight": 0.2}
files called _base_.json
are automatically inherited by every file in the current and child directories, facilitating structural organization.
edit/
entities/
_base_.json (A)
mammals/
_base_.json (B)
cow.json (auto inherits [A B])