Overhauled computations to allow for toggles :'( that sucked

This commit is contained in:
Thaum Rystra
2020-05-16 22:03:21 +02:00
parent 7024adecaf
commit 5c0a2a4d6c
30 changed files with 468 additions and 251 deletions

View File

@@ -32,6 +32,7 @@ const calculationPropertyTypes = [
'effect',
'proficiency',
'classLevel',
'toggle',
];
/**
@@ -71,7 +72,11 @@ const calculationPropertyTypes = [
* - Write the computed results back to the database
*/
export function recomputeCreatureById(creatureId){
let props = getActiveProperties(creatureId, {type: {$in: calculationPropertyTypes}});
let props = getActiveProperties({
ancestorId: creatureId,
filter: {type: {$in: calculationPropertyTypes}},
includeUntoggled: true,
});
let computationMemo = new ComputationMemo(props);
computeMemo(computationMemo);
writeAlteredProperties(computationMemo);