chiark / gitweb /
ilk mixing: Support non-mixing pieces
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Apr 2022 17:11:44 +0000 (18:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Apr 2022 18:15:04 +0000 (19:15 +0100)
commitd61341e9db6dd9cf3d06508b0f26c9aa33ae0154
tree06cb362ec10041803699f0e35140af7f7878cdb1
parentbc321c4078b4c0adf079fb91b72fcc020284aa46
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>
daemon/cmdlistener.rs
src/dice.rs
src/gamestate.rs
src/global.rs
src/hidden.rs
src/occultilks.rs
src/prelude.rs
src/shapelib.rs
src/vpid.rs