vehicle to human completed
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user