The World Model
The WorldModel encompasses the spatial object model, as Inform's literate source puts it. This provides us with everything to specify the layout of the game world, the objects within it, and properties they have. For instance, Things and their name and description and Rooms having mapConnections.
Sections
- WorldModel and WMx Type Families - A neat trick to allow us to extensively parameterise our universes of types (
Objects,Directions,Values, etc) without having to write out a dozen type parameters. - The World State - The record type that holds the game state.
- Objects -
Entity,Object,Storeand how these three types form the backbone of the lookup model.- Entities and Stores - Spoilers:
newtypewrappers aroundInts andnewtypewrappers aroundnewtypewrappers aroundIntMapand making it slightly less painful to deal with object lookups. - Objects, Things and Rooms - Probably the most important part, actual game objects.
- Reification - Dealing with dynamic objects, because doing things as text substitutions is kind of awkward.
- ObjectLike - Some helpers for things which act a bit like
Objects, but aren't actuallyObjects (necessarily). - Object Specifics and Object Data - The section that I could never remember the order of, the components that make
Things things (ObjectData) andSupporters supporters (ObjectSpecifics).
- Entities and Stores - Spoilers:
- Properties - Smaller parts of
ObjectSpecificsthat can be shared by many types ofObject.- Get, Set, Modify -
TemplateHaskellto define our lookup functions.
- Get, Set, Modify -