Tracking de l'application VApp (IHM du jeu)

This commit is contained in:
2025-05-11 18:04:12 +02:00
commit 89e9db9b62
17763 changed files with 3718499 additions and 0 deletions

View File

@ -0,0 +1,67 @@
export const singleOpenStrategy = {
open: _ref => {
let {
id,
value,
opened,
parents
} = _ref;
if (value) {
const newOpened = new Set();
newOpened.add(id);
let parent = parents.get(id);
while (parent != null) {
newOpened.add(parent);
parent = parents.get(parent);
}
return newOpened;
} else {
opened.delete(id);
return opened;
}
},
select: () => null
};
export const multipleOpenStrategy = {
open: _ref2 => {
let {
id,
value,
opened,
parents
} = _ref2;
if (value) {
let parent = parents.get(id);
opened.add(id);
while (parent != null && parent !== id) {
opened.add(parent);
parent = parents.get(parent);
}
return opened;
} else {
opened.delete(id);
}
return opened;
},
select: () => null
};
export const listOpenStrategy = {
open: multipleOpenStrategy.open,
select: _ref3 => {
let {
id,
value,
opened,
parents
} = _ref3;
if (!value) return opened;
const path = [];
let parent = parents.get(id);
while (parent != null) {
path.push(parent);
parent = parents.get(parent);
}
return new Set(path);
}
};
//# sourceMappingURL=openStrategies.mjs.map