Baseline: tree as shared
This commit is contained in:
1679 files changed
+1024562
No files matched your search
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Where the Mojo on screen came from (restructure plan, section 2.4). One pure function answers for every view,
|
||||
* so no screen has to work it out for itself: the Bridge's Mojo is always generated; anywhere else it is whatever
|
||||
* `mojoOrigin` records (absent: written by hand, or an exercise's own program).
|
||||
*/
|
||||
import type { PlayState } from './state.js';
|
||||
import type { AreaId } from './areas.js';
|
||||
|
||||
export type MojoProvenance = 'generated' | 'generated-edited' | null;
|
||||
|
||||
export function mojoProvenance(s: { area: AreaId | null; state: Pick<PlayState, 'mojoOrigin'> }, area: AreaId | null = s.area): MojoProvenance {
|
||||
if (area === 'bridge') return 'generated';
|
||||
return s.state.mojoOrigin ?? null;
|
||||
}
|
||||
Reference in new issue
Block a user