Update changelog and minor fixes

pull/965/head
tobspr 4 years ago
parent 785eb31c8d
commit b17cb6952b

@ -5,6 +5,8 @@ export const CHANGELOG = [
entries: [
"Fixed stacking bug for level 26 which required restarting the game",
"Fix reward notification being too long sometimes (by LeopoldTal)",
"Use locale decimal separator on belt reader display (by LeopoldTal)",
"Vastly improved performance when saving games (by LeopoldTal)",
"Updated translations",
],
},

@ -26,7 +26,8 @@ export const THIRDPARTY_URLS = {
},
};
export const A_B_TESTING_LINK_TYPE = Math.random() > 0.5 ? "steam_1_pr" : "steam_2_npr";
// export const A_B_TESTING_LINK_TYPE = Math.random() > 0.95 ? "steam_1_pr" : "steam_2_npr";
export const A_B_TESTING_LINK_TYPE = "steam_2_npr";
export const globalConfig = {
// Size of a single tile in Pixels.

@ -59,6 +59,12 @@ if (G_IS_DEV) {
}
}
/**
* @param {any} obj
* @param {Map} keys
* @param {Map} values
* @returns {any[]|object|number|string}
*/
function compressObjectInternal(obj, keys, values) {
if (Array.isArray(obj)) {
let result = [];
@ -89,14 +95,21 @@ function compressObjectInternal(obj, keys, values) {
return obj;
}
/**
* @param {Map} hashMap
* @returns {Array}
*/
function indexMapToArray(hashMap) {
const result = [];
const result = new Array(hashMap.size);
hashMap.forEach((index, key) => {
result[index] = key;
});
return result;
}
/**
* @param {object} obj
*/
export function compressObject(obj) {
const keys = new Map();
const values = new Map();
@ -108,6 +121,12 @@ export function compressObject(obj) {
};
}
/**
* @param {object} obj
* @param {string[]} keys
* @param {any[]} values
* @returns {object}
*/
function decompressObjectInternal(obj, keys = [], values = []) {
if (Array.isArray(obj)) {
let result = [];
@ -130,6 +149,9 @@ function decompressObjectInternal(obj, keys = [], values = []) {
return obj;
}
/**
* @param {object} obj
*/
export function decompressObject(obj) {
if (obj.keys && obj.values && obj.data) {
const keys = obj.keys;

Loading…
Cancel
Save