/* indicator table */ var tableIndicators = [["Criminalité",0],["Religion",0],["Economie",0],["Noblesse",0],["Peuple",0]]; var currentTurn = 0; /* */ function genAllIndicators() { let element = document.querySelector("#indicator"); element.innerHTML = genTurn() + "
" + genListeIndicators() + "
"; } /* tour de jeu actuel */ function genTurn() { return '

Tour :

' + currentTurn + "

"; } /* indicator */ function genListeIndicators() { let res = ""; for (var i = 0; i < tableIndicators.length; i++) { res = res + genIndicator(i); } return res; } function genIndicator(i) { return '

' + tableIndicators[i][0] + ' :

' + tableIndicators[i][1] + "

"; } function updateIndicatorsAddLaws(law) { tableIndicators[0][1] = tableIndicators[0][1] + law.effets.cri; tableIndicators[1][1] = tableIndicators[1][1] + law.effets.rel; tableIndicators[2][1] = tableIndicators[2][1] + law.effets.eco; tableIndicators[3][1] = tableIndicators[3][1] + law.effets.nob; tableIndicators[4][1] = tableIndicators[4][1] + law.effets.peu; } function updateIndicatorsRemoveLaws(law) { tableIndicators[0][1] = tableIndicators[0][1] - law.effets.cri; tableIndicators[1][1] = tableIndicators[1][1] - law.effets.rel; tableIndicators[2][1] = tableIndicators[2][1] - law.effets.eco; tableIndicators[3][1] = tableIndicators[3][1] - law.effets.nob; tableIndicators[4][1] = tableIndicators[4][1] - law.effets.peu; } function updateIndicatorsUpgradeLaws(law) { tableIndicators[0][1] = tableIndicators[0][1] + law.effets.cri; tableIndicators[1][1] = tableIndicators[1][1] + law.effets.rel; tableIndicators[2][1] = tableIndicators[2][1] + law.effets.eco; tableIndicators[3][1] = tableIndicators[3][1] + law.effets.nob; tableIndicators[4][1] = tableIndicators[4][1] + law.effets.peu; }