GFM isn't real
This commit is contained in:
parent
24367669e5
commit
1623d29653
|
@ -2,30 +2,30 @@
|
|||
|
||||
because I keep forgetting.
|
||||
|
||||
- [`CastingVM`][] is the casting virtual machine. It is what figures out what to do with an incoming iota to be
|
||||
- [CastingVM][] is the casting virtual machine. It is what figures out what to do with an incoming iota to be
|
||||
executed,
|
||||
producing a functional state update. This is transient and is reconstructed every time the whole state needs to be
|
||||
saved and loaded.
|
||||
- [`CastingImage`][] is the state of the cast itself. If [`CastingVM`][] is an emulator, [`CastingImage`][] is a
|
||||
- [CastingImage][] is the state of the cast itself. If [CastingVM][] is an emulator, [CastingImage][] is a
|
||||
snapshot of the
|
||||
emulator's memory. This is the only thing serialized to NBT.
|
||||
- [`CastingEnvironment`][] is what is doing the casting, abstractly. Stuff like "the player with a staff," "the player
|
||||
- [CastingEnvironment][] is what is doing the casting, abstractly. Stuff like "the player with a staff," "the player
|
||||
with a trinket," "a spell circle." This is an abstract class that Hexcasting (and addons!) make subclasses of.
|
||||
|
||||
## Beware The Pipeline
|
||||
|
||||
1. An iota or list of iotas come to be executed. This is the entrypoint to the VM,
|
||||
`CastingVM#queueAndExecuteIotas`, and returns an [`ExecutionClientView`][] (might change later).
|
||||
2. Those iotas are put into a [`ContinuationFrame`][] (specifically, [`FrameEvaluate`][]).
|
||||
`CastingVM#queueAndExecuteIotas`, and returns an [ExecutionClientView][] (might change later).
|
||||
2. Those iotas are put into a [ContinuationFrame][] (specifically, [FrameEvaluate][]).
|
||||
3. While there are still frames, control flows to the top one.
|
||||
4. The frame (usually) returns control flow back to the VM by calling `CastingVM#executeInner` with an iota.
|
||||
5. `executeInner` first does some pre-checks with intro/retro/consideration (like escaping embedded iotas), but usually
|
||||
makes sure that the passed iota is a pattern and passes *that* on to `executePattern`.
|
||||
6. `executePattern` is where the execution actually happens. The pattern is matched to an action or special handler.
|
||||
and executed.
|
||||
7. That execution doesn't mutate anything, but returns a [`CastResult`]. It contains:
|
||||
7. That execution doesn't mutate anything, but returns a [CastResult]. It contains:
|
||||
- the rest of the current continuation (read as: the patterns to execute next);
|
||||
- the updated state of the [`CastingImage`];
|
||||
- the updated state of the [CastingImage];
|
||||
- a list of `OperatorSideEffects`, like withdrawing media, casting spells or mishaping;
|
||||
- misc display info like the color the pattern should be when drawn to the staff GUI and the sound.
|
||||
8. Each of the side effects is applied to the world in turn. If any of them make the casting stop (like mishaping),
|
||||
|
|
Loading…
Reference in a new issue