Convert things-and-building doc to rst

This commit is contained in:
Jared Miller 2026-02-07 23:39:45 -05:00
parent 0395aaadad
commit 8f3455ce0a
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -1,3 +1,4 @@
===================
things and building things and building
=================== ===================
@ -17,7 +18,7 @@ the decorator pattern
the core idea: things are python classes with decorators. no custom DSL. the core idea: things are python classes with decorators. no custom DSL.
python IS the language. python IS the language.
here's a full example of a pepsi can: here's a full example of a pepsi can::
from mudlib.things import thing, verb from mudlib.things import thing, verb
@ -73,7 +74,7 @@ what's happening here:
- no yaml needed for behavioral things. the python file IS the definition. - no yaml needed for behavioral things. the python file IS the definition.
for static items (no behavior, just a description), we could support TOML-only for static items (no behavior, just a description), we could support TOML-only
for simple cases: for simple cases::
[thing] [thing]
name = "rock" name = "rock"
@ -87,6 +88,8 @@ builder commands
the @ prefix for builder/admin commands. not combat, not normal play. building. the @ prefix for builder/admin commands. not combat, not normal play. building.
::
@create item <name> opens editor with a template python file @create item <name> opens editor with a template python file
@create room <name> opens editor for a new room definition @create room <name> opens editor for a new room definition
@edit <name> opens editor for an existing thing/room @edit <name> opens editor for an existing thing/room
@ -149,7 +152,7 @@ open questions:
map editing map editing
----------- -----------
the map format (TOML) is already writable: the map format (TOML) is already writable::
[map] [map]
width = 20 width = 20
@ -189,14 +192,14 @@ interiors are rooms (classic MUD style) or small grids.
entering: a tile on the overworld has an "enter" action that transitions you entering: a tile on the overworld has an "enter" action that transitions you
to an interior. the interior has an "exit" that puts you back on the overworld. to an interior. the interior has an "exit" that puts you back on the overworld.
a room definition might look like: a room definition might look like::
[room] [room]
name = "tavern" name = "tavern"
description = "a warm tavern. fire crackling. smells like stew." description = "a warm tavern. fire crackling. smells like stew."
exits = { out = "overworld:12,45" } exits = { out = "overworld:12,45" }
or as python if it has behavior: or as python if it has behavior::
@room @room
class Tavern: class Tavern: