chiark / gitweb /
otter.git
3 years agosvg size handling: Rename and move svg_parse_size
Ian Jackson [Mon, 2 May 2022 10:31:43 +0000 (11:31 +0100)]
svg size handling: Rename and move svg_parse_size

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoutils: Drop EmptyType
Ian Jackson [Mon, 2 May 2022 10:26:23 +0000 (11:26 +0100)]
utils: Drop EmptyType

It turns out that there already weren't any use sites.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoutils: Drop some unused bits
Ian Jackson [Mon, 2 May 2022 10:25:18 +0000 (11:25 +0100)]
utils: Drop some unused bits

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoutils: Tidy up and move DigestRead and DigestWrite
Ian Jackson [Mon, 2 May 2022 10:24:13 +0000 (11:24 +0100)]
utils: Tidy up and move DigestRead and DigestWrite

Now this file is more navigable.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agosvg size handling: Introduce new size parser
Ian Jackson [Mon, 2 May 2022 09:56:57 +0000 (10:56 +0100)]
svg size handling: Introduce new size parser

We want to get the size out of the svg on load, to make the library
spec size attribute optional (and to make things less confusing).
So start by add code to parse size out of an SVG.

But in fact it turns out we have one of these in bundle processing
already.  The need to be combined.  But for now, commit what we have.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoFix an error message typo
Ian Jackson [Mon, 2 May 2022 08:53:45 +0000 (09:53 +0100)]
Fix an error message typo

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agousvg-processor: Be a bit more verbose in error messages
Ian Jackson [Mon, 2 May 2022 08:51:27 +0000 (09:51 +0100)]
usvg-processor: Be a bit more verbose in error messages

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocurrency: Example
Ian Jackson [Sun, 1 May 2022 21:45:33 +0000 (22:45 +0100)]
currency: Example

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocurrency: Document
Ian Jackson [Sun, 1 May 2022 21:42:26 +0000 (22:42 +0100)]
currency: Document

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodice: Document
Ian Jackson [Sun, 1 May 2022 21:22:19 +0000 (22:22 +0100)]
dice: Document

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoat-currency: Test merging properly
Ian Jackson [Sun, 1 May 2022 20:15:11 +0000 (21:15 +0100)]
at-currency: Test merging properly

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: handle Delete
Ian Jackson [Sun, 1 May 2022 20:13:04 +0000 (21:13 +0100)]
apitest: updates: handle Delete

We blank out the info in the slot.  That's probably the best we can do
with the current data model.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoat-currency: Rename variables
Ian Jackson [Sun, 1 May 2022 20:08:58 +0000 (21:08 +0100)]
at-currency: Rename variables

This was getting quite confusing.  I think this scheme is less so.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoat-currency: More test
Ian Jackson [Sun, 1 May 2022 20:03:27 +0000 (21:03 +0100)]
at-currency: More test

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: Recorded: Do not overwrite with nulls
Ian Jackson [Sun, 1 May 2022 20:02:41 +0000 (21:02 +0100)]
apitest: updates: Recorded: Do not overwrite with nulls

Some of these fields are Option, and if None, should nto overwrite
existing data.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoat-currency: Add spaces in desc patterns
Ian Jackson [Sun, 1 May 2022 19:49:35 +0000 (20:49 +0100)]
at-currency: Add spaces in desc patterns

We don't want to match numbers which happen to end with our pattern!

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoat-currency: Break out PieceInfo::assert_desc_contains
Ian Jackson [Sun, 1 May 2022 19:48:26 +0000 (20:48 +0100)]
at-currency: Break out PieceInfo::assert_desc_contains

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoat-currency: rename bn to bn1
Ian Jackson [Sun, 1 May 2022 19:36:30 +0000 (20:36 +0100)]
at-currency: rename bn to bn1

These are being taken in sequence.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoReplace make_svg_defs with render
Ian Jackson [Sun, 1 May 2022 19:30:23 +0000 (20:30 +0100)]
Replace make_svg_defs with render

This now demonstrates that there aren't any more svg generation sites
that forget to propagate a possibly-changed desc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoat-currency: Check that descriptions (ie, qts) change
Ian Jackson [Sun, 1 May 2022 18:54:09 +0000 (19:54 +0100)]
at-currency: Check that descriptions (ie, qts) change

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProperly update desc in Recorded updates
Ian Jackson [Sun, 1 May 2022 18:47:55 +0000 (19:47 +0100)]
Properly update desc in Recorded updates

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoat-currency: Use find_by_desc_glob
Ian Jackson [Sun, 1 May 2022 18:44:10 +0000 (19:44 +0100)]
at-currency: Use find_by_desc_glob

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoat-currency: Use currency symbol to find in desc
Ian Jackson [Sun, 1 May 2022 18:34:46 +0000 (19:34 +0100)]
at-currency: Use currency symbol to find in desc

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoscript: Demonstrate that we can use the desc in a log message
Ian Jackson [Sun, 1 May 2022 18:28:28 +0000 (19:28 +0100)]
script: Demonstrate that we can use the desc in a log message

We can now improve many more messages, but I have other fish to fry ATM.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoCorrect sense of pin/unpin log message
Ian Jackson [Sun, 1 May 2022 18:23:00 +0000 (19:23 +0100)]
Correct sense of pin/unpin log message

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide desc even in piece updates, and note in script.ts
Ian Jackson [Sun, 1 May 2022 18:17:38 +0000 (19:17 +0100)]
Provide desc even in piece updates, and note in script.ts

This has always been provided, properly occulted, during session load,
but not provided in updates.  And all this time I have been writing
JS-generated log messages under the assumption that the JS can't
describe pieces.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoat-currency: Use synchu to synchronise, to update a_pieces
Ian Jackson [Sun, 1 May 2022 18:00:47 +0000 (19:00 +0100)]
at-currency: Use synchu to synchronise, to update a_pieces

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: implement MoveQuiet
Ian Jackson [Sun, 1 May 2022 18:08:49 +0000 (19:08 +0100)]
apitest: updates: implement MoveQuiet

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: implement Insert
Ian Jackson [Sun, 1 May 2022 18:08:29 +0000 (19:08 +0100)]
apitest: updates: implement Insert

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: move p unwraps
Ian Jackson [Sun, 1 May 2022 18:08:10 +0000 (19:08 +0100)]
apitest: updates: move p unwraps

So that we can do Insert

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: drop a dbg and the parameter it uses
Ian Jackson [Sun, 1 May 2022 18:02:24 +0000 (19:02 +0100)]
apitest: updates: drop a dbg and the parameter it uses

I'm not sure why nick is passed here.  Whatever.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: reorder generics to match argument order
Ian Jackson [Sun, 1 May 2022 18:01:07 +0000 (19:01 +0100)]
apitest: updates: reorder generics to match argument order

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: panic on unknown updates
Ian Jackson [Sun, 1 May 2022 17:51:07 +0000 (18:51 +0100)]
apitest: updates: panic on unknown updates

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: explicitly ignore Log
Ian Jackson [Sun, 1 May 2022 17:49:55 +0000 (18:49 +0100)]
apitest: updates: explicitly ignore Log

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: explicitly ignore various other updates
Ian Jackson [Sun, 1 May 2022 17:49:20 +0000 (18:49 +0100)]
apitest: updates: explicitly ignore various other updates

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: explicitly ignore SetTable*
Ian Jackson [Sun, 1 May 2022 17:48:08 +0000 (18:48 +0100)]
apitest: updates: explicitly ignore SetTable*

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: handle RecordedUnpredictable
Ian Jackson [Sun, 1 May 2022 17:47:23 +0000 (18:47 +0100)]
apitest: updates: handle RecordedUnpredictable

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: explicitly ignore MoveHist*
Ian Jackson [Sun, 1 May 2022 17:46:08 +0000 (18:46 +0100)]
apitest: updates: explicitly ignore MoveHist*

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: handle Image
Ian Jackson [Sun, 1 May 2022 17:45:25 +0000 (18:45 +0100)]
apitest: updates: handle Image

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Introduce and use JsV extension extend
Ian Jackson [Sun, 1 May 2022 17:43:45 +0000 (18:43 +0100)]
apitest: Introduce and use JsV extension extend

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: Always call findp
Ian Jackson [Sun, 1 May 2022 17:33:16 +0000 (18:33 +0100)]
apitest: updates: Always call findp

This makes the code smaller.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updates: Refactor findp again
Ian Jackson [Sun, 1 May 2022 17:32:24 +0000 (18:32 +0100)]
apitest: updates: Refactor findp again

I keep shilly-shallying.  I think I want this to be called all the time.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Add a comment about what PieceInfo<JsV> means
Ian Jackson [Sun, 1 May 2022 17:23:41 +0000 (18:23 +0100)]
apitest: Add a comment about what PieceInfo<JsV> means

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updatess: Implement Recorded
Ian Jackson [Sun, 1 May 2022 17:22:13 +0000 (18:22 +0100)]
apitest: updatess: Implement Recorded

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: updatess: Expect to find the pieces we are updating
Ian Jackson [Sun, 1 May 2022 17:21:55 +0000 (18:21 +0100)]
apitest: updatess: Expect to find the pieces we are updating

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Break out findp
Ian Jackson [Sun, 1 May 2022 17:21:04 +0000 (18:21 +0100)]
apitest: Break out findp

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Introduce and use JsV extension set
Ian Jackson [Sun, 1 May 2022 17:20:02 +0000 (18:20 +0100)]
apitest: Introduce and use JsV extension set

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: fold lines longer
Ian Jackson [Sun, 1 May 2022 16:03:24 +0000 (17:03 +0100)]
apitest: fold lines longer

Mostly they don't fold now.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Refactor to make room for handling more piece ops
Ian Jackson [Sun, 1 May 2022 16:03:11 +0000 (17:03 +0100)]
apitest: Refactor to make room for handling more piece ops

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Add a bit of logging
Ian Jackson [Sun, 1 May 2022 16:02:58 +0000 (17:02 +0100)]
apitest: Add a bit of logging

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoat-currency: wip
Ian Jackson [Sun, 1 May 2022 14:39:48 +0000 (15:39 +0100)]
at-currency: wip

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocurrency: Fix the log message
Ian Jackson [Sun, 1 May 2022 13:46:28 +0000 (14:46 +0100)]
currency: Fix the log message

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agofastsplit_delete: Implement, and use in currency
Ian Jackson [Sun, 1 May 2022 13:43:04 +0000 (14:43 +0100)]
fastsplit_delete: Implement, and use in currency

Amazingly, this seems to work at least in my basic ad-hoc test.
The log message needs a little work.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoheld_change_hook: Pass some more arguments
Ian Jackson [Sun, 1 May 2022 13:39:09 +0000 (14:39 +0100)]
held_change_hook: Pass some more arguments

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoToReculculate: Slightly improve docs and formatting of with
Ian Jackson [Sun, 1 May 2022 12:02:31 +0000 (13:02 +0100)]
ToReculculate: Slightly improve docs and formatting of with

This was a bit confusing at first.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoToRecalculate: Refactor implement methods
Ian Jackson [Sun, 1 May 2022 11:59:01 +0000 (12:59 +0100)]
ToRecalculate: Refactor implement methods

These are more convenient now, and the authorisation trickery is
now where we can more clearly justify it.

Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodelete_piece: Plumb PieceUpdateOp, and document re log
Ian Jackson [Sun, 1 May 2022 11:39:26 +0000 (12:39 +0100)]
delete_piece: Plumb PieceUpdateOp, and document re log

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodelete_piece: Break out into global.rs
Ian Jackson [Sun, 1 May 2022 11:19:35 +0000 (12:19 +0100)]
delete_piece: Break out into global.rs

fastsplit deletion is going to want this.  This may not be in its
final form, particularly because of ToRecalculate, which fastsplit
doesn't have one of yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agorename GOccults from GameOccults
Ian Jackson [Sun, 1 May 2022 11:14:12 +0000 (12:14 +0100)]
rename GOccults from GameOccults

Tried to refer to it as GOccults (without looking it up) and obviously
that's what it ought to be.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoRemove a pointless function
Ian Jackson [Sun, 1 May 2022 10:36:44 +0000 (11:36 +0100)]
Remove a pointless function

This seems to just recurse to itself.  Deleting it leaves everything
still compiling.  How odd.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoChange many .drain(..) into into_iter()
Ian Jackson [Sun, 1 May 2022 10:35:33 +0000 (11:35 +0100)]
Change many .drain(..) into into_iter()

In Rust 2021 this is more convenient to write.  We retain one.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMiscellaneous cleanups prompted by clippy
Ian Jackson [Sun, 1 May 2022 10:34:58 +0000 (11:34 +0100)]
Miscellaneous cleanups prompted by clippy

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoOpOutcomeThunk: replace the other open-coded resolution site
Ian Jackson [Sun, 1 May 2022 10:15:44 +0000 (11:15 +0100)]
OpOutcomeThunk: replace the other open-coded resolution site

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoOpOutcomeThunk: change resolve to be method on thunk
Ian Jackson [Sun, 1 May 2022 10:13:36 +0000 (11:13 +0100)]
OpOutcomeThunk: change resolve to be method on thunk

The other call site (which will come in a moment) doesn't have a
Result.  And this was a bit too cooked anyway.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoIntroduce OpOutcomeThunkGeneric resolve on Result
Ian Jackson [Sun, 1 May 2022 10:08:59 +0000 (11:08 +0100)]
Introduce OpOutcomeThunkGeneric resolve on Result

On the way to getting rid of the other ad-hoc resolution site.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoGenericise OpOutcomeThunk
Ian Jackson [Sun, 1 May 2022 10:03:10 +0000 (11:03 +0100)]
Genericise OpOutcomeThunk

So that we can centralise resolution.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoOpOutcomeThunk: Fix typo in comment
Ian Jackson [Sun, 1 May 2022 09:53:26 +0000 (10:53 +0100)]
OpOutcomeThunk: Fix typo in comment

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoReplace an open-coded into_unprepared call
Ian Jackson [Sun, 1 May 2022 01:38:13 +0000 (02:38 +0100)]
Replace an open-coded into_unprepared call

Found this will looking at this code.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoOptimise into_unprepared slightly
Ian Jackson [Sun, 1 May 2022 01:37:33 +0000 (02:37 +0100)]
Optimise into_unprepared slightly

Prompted by seeing this optimisation at what ought to be a call site
of this method.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoIntroduce OpHookThunk
Ian Jackson [Sun, 1 May 2022 00:31:56 +0000 (01:31 +0100)]
Introduce OpHookThunk

Currency merge needs this so that it can reborrow ipieces to delete
one of the merged notes.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoOpOutcomeThunk: Rationalise doc comment
Ian Jackson [Sun, 1 May 2022 00:12:34 +0000 (01:12 +0100)]
OpOutcomeThunk: Rationalise doc comment

Most of this comment is from earlier thoughts about how to solve the
problme that fastsplit now solves, and much of it wasn't really right.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoFix a tiny whitespace error
Ian Jackson [Sun, 1 May 2022 00:10:08 +0000 (01:10 +0100)]
Fix a tiny whitespace error

Noticed in passing.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoscript: Allow multiselect of large numbers
Ian Jackson [Sat, 30 Apr 2022 23:32:55 +0000 (00:32 +0100)]
script: Allow multiselect of large numbers

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoscript: In error handler, use piece_checkconflict_nrda
Ian Jackson [Sat, 30 Apr 2022 23:09:12 +0000 (00:09 +0100)]
script: In error handler, use piece_checkconflict_nrda

This arranges that we stop drag if our grab failed for reasons other
than a conflict which is obvious to us.  Eg, insufficient currency.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoscript: piece_checkconflict_nrda: abolish unused return value
Ian Jackson [Sat, 30 Apr 2022 23:03:25 +0000 (00:03 +0100)]
script: piece_checkconflict_nrda: abolish unused return value

This was always false, and no longer used apparently.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoIntroduce and use PieceTraitDowncastFailed error
Ian Jackson [Sat, 30 Apr 2022 17:47:21 +0000 (18:47 +0100)]
Introduce and use PieceTraitDowncastFailed error

We want this to be cheap to make - not InternalError which contains a
stack trace - so that we can use downcast_piece in contexts where it's
not an error.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoIntroduce and use downcast_piece_fastsplit
Ian Jackson [Sat, 30 Apr 2022 17:07:10 +0000 (18:07 +0100)]
Introduce and use downcast_piece_fastsplit

Currency wants this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoIntroduce and use PiceTrait downcaste_piece extension methoc
Ian Jackson [Sat, 30 Apr 2022 15:43:44 +0000 (16:43 +0100)]
Introduce and use PiceTrait downcaste_piece extension methoc

This is more convenient.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agogamestate: Add divider comment
Ian Jackson [Sat, 30 Apr 2022 15:32:35 +0000 (16:32 +0100)]
gamestate: Add divider comment

We're going to add more above here, and it's getting big.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agofastsplit: Move Z check from multigrab into fastsplit impl
Ian Jackson [Sat, 30 Apr 2022 12:28:43 +0000 (13:28 +0100)]
fastsplit: Move Z check from multigrab into fastsplit impl

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agofastsplit: Correct z order
Ian Jackson [Sat, 30 Apr 2022 12:24:21 +0000 (13:24 +0100)]
fastsplit: Correct z order

This was back to front.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoReorganise Z setting into two phases
Ian Jackson [Sat, 30 Apr 2022 12:21:34 +0000 (13:21 +0100)]
Reorganise Z setting into two phases

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMove op_do_set_z to gamestate
Ian Jackson [Sat, 30 Apr 2022 12:21:00 +0000 (13:21 +0100)]
Move op_do_set_z to gamestate

This is preparatory, to reduce diff noise.  We're going to change the
way this works in a moment.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agofastsplit: Move a comment to its right place
Ian Jackson [Sat, 30 Apr 2022 11:05:12 +0000 (12:05 +0100)]
fastsplit: Move a comment to its right place

Some time in the development of this, pre-squash, kthe modperm was
acquired within the infallible closure.  But when it was moved,
evidently the comment didn't move with it.  Fix that.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agofastsplit: Fix recovery
Ian Jackson [Sat, 30 Apr 2022 09:58:53 +0000 (10:58 +0100)]
fastsplit: Fix recovery

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocurrency: Fix and improve multigrab (splitting) log message
Ian Jackson [Sat, 30 Apr 2022 01:24:13 +0000 (02:24 +0100)]
currency: Fix and improve multigrab (splitting) log message

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agomultigrab/fastsplit: Plumb ShowUnocculted and &PieceTrait
Ian Jackson [Sat, 30 Apr 2022 01:21:05 +0000 (02:21 +0100)]
multigrab/fastsplit: Plumb ShowUnocculted and &PieceTrait

The implementation doesn't really want PieceRenderingInstructions,
just permission to get at trait objects.

The currency fastsplit implementation callback is going to want to
look at its Banknote so that it can make a nice log message.  I think
fastsplit piece impls are entitled access to their concret piece type.
So downcast it, and pass it down the layers.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoPieceTrait: impl Downcast
Ian Jackson [Sat, 30 Apr 2022 01:21:13 +0000 (02:21 +0100)]
PieceTrait: impl Downcast

We're going to want this in a moment.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocurrency: Many fixes to splitting
Ian Jackson [Sat, 30 Apr 2022 12:13:12 +0000 (13:13 +0100)]
currency: Many fixes to splitting

This was quite broken.

* Actually set the value of the new (change) piece.
* Set the value of tghe taken piece correctly.
* Set the WRC so that clients see the taken piece value.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocurrency: Move some assignments about
Ian Jackson [Sat, 30 Apr 2022 12:13:07 +0000 (13:13 +0100)]
currency: Move some assignments about

Tidying up.  No functional change.
(Was originally part of the next, bugfix, commit.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocurrency: Rename value
Ian Jackson [Sat, 30 Apr 2022 12:10:38 +0000 (13:10 +0100)]
currency: Rename value

Having the two pieces here is confusing.  All the variables should say
which piece they are.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocurrency: wip test
Ian Jackson [Mon, 18 Apr 2022 15:32:20 +0000 (16:32 +0100)]
currency: wip test

So far we test that splitting appears to succeed, but not what the
results look like.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocurrency: Implement op_multigrab and therefore splitting
Ian Jackson [Mon, 18 Apr 2022 23:01:39 +0000 (00:01 +0100)]
currency: Implement op_multigrab and therefore splitting

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
ng

3 years agofastsplit: Implement splitting
Ian Jackson [Sat, 30 Apr 2022 10:14:23 +0000 (11:14 +0100)]
fastsplit: Implement splitting

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocurrency: Make currency pieces be fastsplit
Ian Jackson [Mon, 25 Apr 2022 22:58:31 +0000 (23:58 +0100)]
currency: Make currency pieces be fastsplit

The actual machinery does all the hard work.

This shouldn't have any overall visible functional change.  It just
engages new contraptions during piece creation and load/save, but
right now they shouldn't have any work to do because we don't actually
ever split (or merge) currency.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agofastsplit: Add some imprecations about not dropping FastSplitId
Ian Jackson [Sat, 30 Apr 2022 10:14:17 +0000 (11:14 +0100)]
fastsplit: Add some imprecations about not dropping FastSplitId

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agofastsplit: Introduce fastsplit concept
Ian Jackson [Wed, 20 Apr 2022 08:40:03 +0000 (09:40 +0100)]
fastsplit: Introduce fastsplit concept

This has all the relevant data structures and support code, but does
not yet implemnet the actual splitting and deleting/merging
operations which will be needed for the piece api op impls.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDrop an unneeded lifetime argument
Ian Jackson [Sat, 30 Apr 2022 11:46:08 +0000 (12:46 +0100)]
Drop an unneeded lifetime argument

This is not needed.  (I'm not sure whether I did this because
ambassador didn't like the lifetime argument, or just because I saw it
in passing.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoambassador: Introduce dependency and make some traits delegatiable
Ian Jackson [Sat, 23 Apr 2022 19:19:23 +0000 (20:19 +0100)]
ambassador: Introduce dependency and make some traits delegatiable

fastsplit pieces are going to want to delegate everything.  Not only
is this a lot of typing, open-coding it risks bugs when new trait
methods are added.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agomultigrab: Set the z coordinate
Ian Jackson [Sat, 30 Apr 2022 11:42:01 +0000 (12:42 +0100)]
multigrab: Set the z coordinate

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>