@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
23 lines (18 loc) • 583 B
JavaScript
/**
* Checks that elements in supplied arrays are exactly equal within a certain range defined by a pair of offsets and element count (length)
* @template T
* @param {T[]|Float32Array} a
* @param {number} offset_a
* @param {T[]|Float32Array} b
* @param {number} offset_b
* @param {number} length
* @returns {boolean}
*/
export function array_range_equal_strict(a, offset_a, b, offset_b, length) {
for (let i = 0; i < length; i++) {
if (a[offset_a + i] !== b[offset_b + i]) {
return false;
}
}
return true;
}