docs: explain shared CatWar calculator helpers
This commit is contained in:
1 parent
7df69196c5
commit
915ac6bfb8
1 file changed
+5
@@ -1991,11 +1991,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Keeps the goal calculator's Russian hour label grammatically correct.
|
||||
function updateHourWord() {
|
||||
const hours = sets[catId].hours;
|
||||
$('#hour-word').text(declOfNum(hours, ['час', 'часа', 'часов']));
|
||||
}
|
||||
|
||||
// Converts an action duration descriptor into minutes for calculations.
|
||||
function actLength(d) {
|
||||
const minus = sets[catId].minus || 0;
|
||||
if (d <= 14) return 150 - minus;
|
||||
@@ -2003,6 +2005,7 @@
|
||||
else return Math.ceil(150 - d / 15) - minus;
|
||||
}
|
||||
|
||||
// Estimates remaining training time from progress and daily capacity.
|
||||
function left(currentActivity, goal, hoursPerDay) {
|
||||
const secsPerDay = convertTime('h s', hoursPerDay);
|
||||
if (actLength(currentActivity) * 4 + 1 > secsPerDay) {
|
||||
@@ -2040,6 +2043,7 @@
|
||||
};
|
||||
}
|
||||
|
||||
// Recalculates and renders the visible remaining-time estimate.
|
||||
function updateToact() {
|
||||
if (progress.stage === actStages.length - 1) {
|
||||
$('#toact').hide();
|
||||
@@ -2716,6 +2720,7 @@
|
||||
}
|
||||
}
|
||||
/*
|
||||
// Synchronizes the calculator with the currently selected training page.
|
||||
function changeTimePage() {
|
||||
const catTimeNow = timestampToCatTime(Date.now());
|
||||
$(isDesctop ? '#branch' : '#site_table').append(`
|
||||
|
||||
Reference in new issue
Block a user