src/utils/military.ts
Function calculateTotalMilitaryStats
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function calculateTotalMilitaryStats(military:Collection<Soldier>, soldier:Citizen, playerCiv:Civilization) {
console.log(soldier);
let statsContainer = u.elt('.assignment-total');
let totalAssigned = u.elt('.soldiers-assigned');
Function militaryUnitChange
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function militaryUnitChange(military:Collection<Soldier>, soldier:Citizen, playerCiv:Civilization) {
iterateOverNodelist(u.elt('.military-assignment-input', true), (item:HTMLInputElement, index) => {
item.addEventListener('change', (event:Event) => {
let unitName = item.getAttribute('data-unit');
let unit:Soldier = military.get(unitName);