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, Thing
s and their name
and description
and Room
s 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
,Store
and how these three types form the backbone of the lookup model.- Entities and Stores - Spoilers:
newtype
wrappers aroundInt
s andnewtype
wrappers aroundnewtype
wrappers aroundIntMap
and 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
Object
s, but aren't actuallyObject
s (necessarily). - Object Specifics and Object Data - The section that I could never remember the order of, the components that make
Thing
s things (ObjectData
) andSupporter
s supporters (ObjectSpecifics
).
- Entities and Stores - Spoilers:
- Properties - Smaller parts of
ObjectSpecifics
that can be shared by many types ofObject
.- Get, Set, Modify -
TemplateHaskell
to define our lookup functions.
- Get, Set, Modify -