@@ -18,6 +18,9 @@ export const useMapFile = () => useAtom(mapFileAtom);
1818export const useScenarioFile = ( ) => useAtom ( scenarioFileAtom ) ;
1919export const useSolutionFile = ( ) => useAtom ( solutionFileAtom ) ;
2020
21+ export const flipAtom = atom < boolean > ( false ) ;
22+ export const useFlip = ( ) => useAtom ( flipAtom ) ;
23+
2124// ─── Computed ────────────────────────────────────────────────────────────────
2225
2326export function useSolutionContents ( ) {
@@ -56,6 +59,7 @@ export function useRun() {
5659 const [ mapFile ] = useAtom ( mapFileAtom ) ;
5760 const [ scenarioFile ] = useAtom ( scenarioFileAtom ) ;
5861 const [ solutionFile ] = useAtom ( solutionFileAtom ) ;
62+ const [ flip ] = useFlip ( ) ;
5963 const { data : contents } = useSolutionContents ( ) ;
6064 const append = useSetAtom ( appendAtom ) ;
6165 const clear = useSetAtom ( clearAtom ) ;
@@ -76,6 +80,7 @@ export function useRun() {
7680 map : await mapFile . text ( ) ,
7781 scen : await scenarioFile . text ( ) ,
7882 paths : await solutionFile . text ( ) ,
83+ flipXY : flip ,
7984 } ;
8085 let actions : State [ ] = [ ] ;
8186 const f = throttle (
@@ -97,7 +102,9 @@ export function useRun() {
97102 clear ( ) ;
98103 const s = client . run . subscribe ( options , {
99104 // Dodgy server sometimes outputs second option
100- onData : ( a : { data : Output [ ] , id : string } | [ string , Output [ ] , null ] ) => {
105+ onData : (
106+ a : { data : Output [ ] ; id : string } | [ string , Output [ ] , null ]
107+ ) => {
101108 const data = isArray ( a ) ? a [ 1 ] : a . data ;
102109 for ( const d of data ) {
103110 if ( "type" in d ) {
0 commit comments