-
-
Notifications
You must be signed in to change notification settings - Fork 0
Determine role ratios from predetermined configurations #2
Copy link
Copy link
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
Assuming
roleConfigsis an array of role configurations that scale with the player quantity that is used to determine the average ratio of roles per game.
roleConfigs.map(({ roles, playerCount }) => {
return roles.map(({ role, count }) => ({
role, ratio: count / playerCount
}))
}).reduce((prev, next) => {
return next.map(({ role, ratio }, index) => {
return { role, ratio: (prev[index]?.ratio || 0) + ratio }
});
}, []).map(({ role, ratio }, index, array) => ({ role, ratio: ratio / array.length }));The following assumes that the sum of count found in each role is equal to that of playerCount for that particular configuration - which is then used to determine the ratio of roles for that game, and then again with the output of that result to determine an average.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request