inform7

How to assign a relation by default to a kind of things


I'm new to Inform 7. I've been playing around with the 'Bogart' example which provides some rules for clothing.

I would like to define kinds of clothing, eg:

Pair of socks is a kind of clothing.
Pair of shoes is a kind of clothing.

Then I'd like to say, similar to how you do with properties:

A pair of socks usually underlies a pair of shoes.
A pair of shoes usually overlies a pair of socks.

So far I think this is not possible, you can only make relations between things (instances) rather than kinds (classes). Is there a way to provide 'default' relations from all instances of a kind to all instances of another kind though?

Is there a way of modelling this without relations?


Solution

  • See section 4.15 Assemblies and body parts in the manual.

    Now you can't do it without any relations at all, but you can do it with the built in containment relation. So you could write

    One pair of socks are in every pair of shoes.

    You can experiment further to see what is possible. If it's not possible you may just need to set it up at runtime with a "when play begins" rule.