So, I wanted to be able to write
Mr Socks is a pink and green knitted cat.
Looking at various examples, colour usually seems to be modelled as a property. That seems to work well enough for things with a single colour. However Mr Socks is stripy, so this won’t work…
Modelling the colours as a list does work, but I couldn’t make it read well:
Mr Socks is a knitted cat. The colour is {pink, green}.
Yuck! Also it’s tedious for those objects which are non-stripey (how gauche!) and have to be described with a single-valued list.
Worse, I couldn’t find a simple way to “understand” the colours. e.g. refer to “pink” or “the green cat” automatically. Understand’ing a property seems to work only for single values, not a list of them.
For now, I’ve come up with this, which is verbose, but seems to do what I want:
[code]A hue is a kind of thing. [not a value, because we want a printed name]
A thing can be pink.
Pinkness is a hue. The printed name is “pink”.
Understand the pink property as describing a thing.
A thing can be green.
Greenness is a hue. The printed name is “green”.
Understand the green property as describing a thing.
To decide what list of hues is the colour of (T - a thing):
Let L be a list of hues;
if T is pink, add pinkness to L;
if T is green, add greenness to L;
decide on L.
A cat is a kind of animal.
A cat can be knitted.
Mr Socks is a pink and green knitted cat.
He is in a room called the Kitchen.
When play begins: say “Mr Socks is [the colour of Mr Socks].”[/code]
Is that a reasonable approach? I’d like to define these colours in a table, but it doesn’t seem to be possible to put a property in a table.
I’m assuming it’s possible to make that more compact (certainly by dropping into Inform6 as a last resort), but that’s a secondary concern.