mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Get rid of performance warning, refactor roman numbers, mark balancers, rebalance upgrades
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
/* typehints:start */
|
||||
import { Application } from "../application";
|
||||
/* typehints:end */
|
||||
import { IS_MAC } from "./config";
|
||||
import { ExplainedResult } from "./explained_result";
|
||||
import { queryParamOptions } from "./query_parameters";
|
||||
|
||||
@@ -713,3 +713,40 @@ export function startFileChoose(acceptedType = ".bin") {
|
||||
input.click();
|
||||
});
|
||||
}
|
||||
|
||||
const romanLiterals = [
|
||||
"0", // NULL
|
||||
"I",
|
||||
"II",
|
||||
"III",
|
||||
"IV",
|
||||
"V",
|
||||
"VI",
|
||||
"VII",
|
||||
"VIII",
|
||||
"IX",
|
||||
"X",
|
||||
"XI",
|
||||
"XII",
|
||||
"XIII",
|
||||
"XIV",
|
||||
"XV",
|
||||
"XVI",
|
||||
"XVII",
|
||||
"XVIII",
|
||||
"XIX",
|
||||
"XX",
|
||||
];
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {number} number
|
||||
* @returns {string}
|
||||
*/
|
||||
export function getRomanNumber(number) {
|
||||
number = Math.max(0, Math.round(number));
|
||||
if (number < romanLiterals.length) {
|
||||
return romanLiterals[number];
|
||||
}
|
||||
return String(number);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user