diff --git a/src/js/utilsFC.js b/src/js/utilsFC.js index 956d773cb39098f7f6aefdf7ad6220a58c5f6768..4367d1161da606dfbc122e2b8fedd946d0371bd8 100644 --- a/src/js/utilsFC.js +++ b/src/js/utilsFC.js @@ -94,15 +94,6 @@ globalThis.arrayToSentence = function(array) { return array.reduce((res, ch, i, arr) => res + (i === arr.length - 1 ? ' and ' : ', ') + ch); }; -/** - * @param {string[]} [assignments] array of assignment strings. The default is to count for all assignments - * @returns {Object.<string, number>} - */ -App.Utils.countAssignmentWorkers = function(assignments) { - assignments = assignments || Object.values(Job); - return assignments.reduce((acc, cur) => { acc[cur] = V.JobIDMap[cur].size; return acc; }, {}); -}; - /** Notify the game that the sidebar needs to be refreshed as soon as possible, but do not do it immediately. * This allows us to call this function repeatedly without impacting performance (for example, from repX() and cashX()). * The game will redraw the sidebar exactly once, as soon as all the scripts have finished executing. diff --git a/src/js/utilsSlaves.js b/src/js/utilsSlaves.js index ff68e668055e9e1bfbeabd071695b1f219f8a3fd..79222bba4de3558011b209d9be326bb6d86eba17 100644 --- a/src/js/utilsSlaves.js +++ b/src/js/utilsSlaves.js @@ -226,3 +226,12 @@ App.Utils.countFacilityWorkers = function(facilities = null, mapping = {}) { acc[mapping[cur.desc.baseName] || cur.desc.baseName] = cur.employeesIDs().size; return acc; }, {}); }; + +/** + * @param {string[]} [assignments] array of assignment strings. The default is to count for all assignments + * @returns {Object.<string, number>} + */ +App.Utils.countAssignmentWorkers = function(assignments) { + assignments = assignments || Object.values(Job); + return assignments.reduce((acc, cur) => { acc[cur] = V.JobIDMap[cur].size; return acc; }, {}); +};