chiark / gitweb /
ilk mixing: Support non-mixing pieces
Allow us to handle an pieces which are occultable but which don't
participate in shuffling and displacement.
I. Introduce IOccultIlk enum. The old approach is the variant Mix.
This allows us to introduce a new approach Distinct.
II. Make Notch optional in Passive Replace the unconditional
OccultIlkOwningId in IPiece with a new enum IOccultIlk, and the
OccultIlkName in the return value from PieceSpec::load with a new enum
LOccultIlk.
III. Immediately use the new approach for dice, dropping all handling
of ilks. (Combining this into this commit avoids writing a bunch of
daft code that will be deleted right away.)
Consequences and ancillary changes:
* We need a new compatibility arrangement so we can load old
savefiles. This is a bit fiddly and involves some macro
trickery (which we will be moved to another file in due course).
* OccultIlks gets two new methods from_iilk and dispose_iilk for
handling IOccultIlk, rather than merely OccultIlkName.
(We're going to move creation in here too, shortly.)
* All existing pieces other than dice are still mixed by ilk.
Allowing this not to be the case ia a question for the future.
* Rename Passive.notch to Passive.permute_notch, for clarity
of its purpose.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>