@zakkster/lite-fastbit32 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Fastbit32.js +5 -5
- package/package.json +1 -1
package/Fastbit32.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* converted to unsigned 32-bit integers (e.g., `-1 >>> 0` becomes `4294967295`).
|
|
9
9
|
* Sanitize your inputs upstream if your domain logic requires strict bounds!
|
|
10
10
|
*/
|
|
11
|
-
export class
|
|
11
|
+
export class FastBit32 {
|
|
12
12
|
constructor(initial = 0) {
|
|
13
13
|
this.value = initial >>> 0;
|
|
14
14
|
}
|
|
@@ -114,7 +114,7 @@ export class Fastbit32 {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
clone() {
|
|
117
|
-
return new
|
|
117
|
+
return new FastBit32(this.value);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
// ── Serialization (For ECS Save States) ──────────────────
|
|
@@ -130,7 +130,7 @@ export class Fastbit32 {
|
|
|
130
130
|
* Instantiates a new FastBit32 from a serialized integer.
|
|
131
131
|
*/
|
|
132
132
|
static deserialize(value) {
|
|
133
|
-
return new
|
|
133
|
+
return new FastBit32(value);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
/**
|
|
@@ -173,10 +173,10 @@ export class BitMapper {
|
|
|
173
173
|
return mask >>> 0;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
getActiveNames(
|
|
176
|
+
getActiveNames(FastBit32Instance) {
|
|
177
177
|
const active = [];
|
|
178
178
|
for (const [name, bit] of this._map.entries()) {
|
|
179
|
-
if (
|
|
179
|
+
if (FastBit32Instance.has(bit)) active.push(name);
|
|
180
180
|
}
|
|
181
181
|
return active;
|
|
182
182
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakkster/lite-fastbit32",
|
|
3
3
|
"author": "Zahary Shinikchiev <shinikchiev@yahoo.com>",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"description": "Zero-GC, monomorphic 32-bit flag manager and ECS masking primitive for high-performance game loops.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|