Skip to content

Commit ad6d4c4

Browse files
authored
Merge pull request #18 from Lin064/support_action_cost
[16] Fix the animation issue when domain with action cost
2 parents c8fb79f + 68596b4 commit ad6d4c4

File tree

5 files changed

+307
-229
lines changed

5 files changed

+307
-229
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"workbox-webpack-plugin": "5.1.4"
8181
},
8282
"scripts": {
83-
"start": "NODE_OPTIONS=--openssl-legacy-provider node scripts/start.js",
83+
"start": "NODE_OPTIONS=--openssl-legacy-provider node scripts/start.js ",
8484
"build": "NODE_OPTIONS=--openssl-legacy-provider node scripts/build.js",
8585
"test": "jest"
8686
},

src/pages/PageFour/dataUtils.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function getSubGoal() {
4141
}
4242
}
4343
map.set(currentStep, vidualSteps)
44-
}
44+
}
4545
})
4646
return map;
4747
}
@@ -78,5 +78,22 @@ export const subGoal = getSubGoal();
7878
export const stepSubgoalMap = getStepSubgoalMap();
7979
export const vfg = contentObject;
8080
export const textContent = content
81+
82+
const visualStages = contentObject["visualStages"]?contentObject["visualStages"]: []
83+
84+
export const stepCosts = Array.from(
85+
new Set(
86+
visualStages.map((item,index, arr)=>{
87+
if (index === 0) {
88+
return 0;
89+
} else {
90+
return (item.cost - arr[index - 1].cost)? (item.cost - arr[index - 1].cost):0 ;
91+
}
92+
})
93+
)
94+
)
95+
96+
export const maxStepCost = [...stepCosts].sort((a, b) => a - b)[stepCosts.length - 1];
97+
8198
//export const initialPos = getInitialBlocksPos();
8299
//export default null;

0 commit comments

Comments
 (0)