Refactor simulation paths to simulation states
- Updated all instances of `simulationPaths` to `simulationStates` across multiple components including copyPasteControls, duplicationControls, moveControls, rotateControls, selectionControls, and others. - Adjusted related state management hooks in the store to reflect the change from `simulationPaths` to `simulationStates`. - Ensured that all references to simulation paths in the simulation logic and UI components are consistent with the new naming convention.
This commit is contained in:
@@ -341,8 +341,8 @@ export const useSelectedPath = create<any>((set: any) => ({
|
||||
}));
|
||||
|
||||
interface SimulationPathsStore {
|
||||
simulationPaths: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[];
|
||||
setSimulationPaths: (
|
||||
simulationStates: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[];
|
||||
setSimulationStates: (
|
||||
paths:
|
||||
| (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[]
|
||||
| ((prev: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[]
|
||||
@@ -350,12 +350,12 @@ interface SimulationPathsStore {
|
||||
) => void;
|
||||
}
|
||||
|
||||
export const useSimulationPaths = create<SimulationPathsStore>((set) => ({
|
||||
simulationPaths: [],
|
||||
setSimulationPaths: (paths) =>
|
||||
export const useSimulationStates = create<SimulationPathsStore>((set) => ({
|
||||
simulationStates: [],
|
||||
setSimulationStates: (paths) =>
|
||||
set((state) => ({
|
||||
simulationPaths:
|
||||
typeof paths === "function" ? paths(state.simulationPaths) : paths,
|
||||
simulationStates:
|
||||
typeof paths === "function" ? paths(state.simulationStates) : paths,
|
||||
})),
|
||||
}))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user