vehicle to human completed

This commit is contained in:
2025-07-17 12:54:47 +05:30
parent fe09c3df56
commit 1d6d42b358
13 changed files with 120 additions and 60 deletions

View File

@@ -12,6 +12,8 @@ interface HumansStore {
) => void;
clearHumans: () => void;
setCurrentPhase: (modelUuid: string, phase: string) => void;
addCurrentAction: (modelUuid: string, actionUuid: string) => void;
removeCurrentAction: (modelUuid: string) => void;
@@ -58,6 +60,7 @@ export const createHumanStore = () => {
state.humans.push({
...event,
productUuid,
currentPhase: 'init',
isActive: false,
isScheduled: false,
idleTime: 0,
@@ -92,6 +95,15 @@ export const createHumanStore = () => {
});
},
setCurrentPhase: (modelUuid, phase) => {
set((state) => {
const human = state.humans.find(h => h.modelUuid === modelUuid);
if (human) {
human.currentPhase = phase;
}
});
},
addCurrentAction: (modelUuid, actionUuid) => {
set((state) => {
const human = state.humans.find(h => h.modelUuid === modelUuid);