@@ -2,14 +2,14 @@ import * as React f
22import { useEffect , useRef , useState , useMemo } from 'react' ;
33import { useSpring } from 'react-spring' ;
44import board from './Board' ;
5- import { _BoardReset } from '../Algorithms/Maze /Tools' ;
6- import { PATH_TYPE , DEFAULT_TYPE , FLOOR_TYPE , WALL_TYPE , START_TYPE , GOAL_TYPE } from '../../Utility/Colors' ;
7- import { BinaryTreeCreation } from '../Algorithms/Maze /Generation/BinaryTreeCreation' ;
8- import { RecursiveBacktrackCreation } from '../Algorithms/Maze /Generation/RecursiveBacktrackCreation' ;
9- import { GrowingTreeCreation } from '../Algorithms/Maze /Generation/GrowingTreeCreation' ;
10- import { BfsCreation } from '../Algorithms/Maze /Generation/BfsCreation' ;
11- import { RecursiveBacktrackSolution } from '../Algorithms/Maze /Solving/RecursiveBacktrackSolution' ;
12- import { BfsSolution } from '../Algorithms/Maze /Solving/BfsSolution' ;
5+ import { _BoardReset } from './Tools' ;
6+ import { PATH_TYPE , DEFAULT_TYPE , FLOOR_TYPE , WALL_TYPE , START_TYPE , GOAL_TYPE } from '../../../ Utility/Colors' ;
7+ import { BinaryTreeCreation } from './Generation/BinaryTreeCreation' ;
8+ import { RecursiveBacktrackCreation } from './Generation/RecursiveBacktrackCreation' ;
9+ import { GrowingTreeCreation } from './Generation/GrowingTreeCreation' ;
10+ import { BfsCreation } from './Generation/BfsCreation' ;
11+ import { RecursiveBacktrackSolution } from './Solving/RecursiveBacktrackSolution' ;
12+ import { BfsSolution } from './Solving/BfsSolution' ;
1313
1414
1515
@@ -76,16 +76,14 @@ export function useSolver({board, solving, algorithm, onFrame}) {
7676 const [ solved , setSolved ] = useState ( false ) ;
7777 const prevSelection = useRef ( algorithm ) ;
7878 const animation = useSpring ( {
79- solvingProgress : 1 ,
80- from : { solvingProgress : 0 } ,
81- reset : algorithm !== prevSelection . current ,
82- onFrame : ( { animationProgress} ) => {
83- // interpolate based on progress
84- // drawPathing(board, solvingProgress);
85- // callback to indicate data has updated
86- // onFrame({ solvingProgress });
87- } ,
88- } ) ;
79+ solvingProgress : 1 ,
80+ from : { solvingProgress : 0 } ,
81+ reset : algorithm !== prevSelection . current ,
82+ onFrame : ( { solvingProgress} ) => {
83+ onFrame ( solvingProgress ) ;
84+ } ,
85+ } ,
86+ ) ;
8987 prevSelection . current = algorithm ;
9088
9189 return animation ;
@@ -151,7 +149,7 @@ export function standardLayout(board) {
151149
152150 node . x = col ; /* .05; */
153151 node . y = row ; /* .05; */
154- node . z = 0 ;
152+ node . z = 0 ;
155153 }
156154}
157155
0 commit comments