Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "bitecs", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Tiny, data-driven, high performance ECS library written in Javascript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -61,3 +61,3 @@ # 👾 bitECS 👾 | ||
// called once, after the system update | ||
onAfter: (pos, vel) => {} | ||
onAfter: (pos, vel) => {}, | ||
// called per entity, before the system updates it | ||
@@ -64,0 +64,0 @@ onBeforeEach: (pos, vel) => eid => {}, |
@@ -82,2 +82,4 @@ import DataManager from './DataManager.js' | ||
throw new Error(`bitECS Error: cannot add component to entityId ${eid}, '${name}' is not registered.`) | ||
if((entities[eid] & componentManager._bitflag) === componentManager._bitflag) return | ||
@@ -90,3 +92,4 @@ // first, add bitflag to entity bitmask | ||
let system = registry.systems[s] | ||
if(system.check(entities[eid])) | ||
if((system.mask & componentManager._bitflag) === componentManager._bitflag | ||
&& system.check(entities[eid])) | ||
system.add(eid) | ||
@@ -104,2 +107,5 @@ } | ||
const _removeComponent = (name, eid) => { | ||
if(!(entities[eid] & componentManager._bitflag)) return | ||
// first, remove flag from entity bitmask | ||
@@ -228,10 +234,2 @@ entities[eid] &= ~registry.components[name]._bitflag | ||
// thread // | ||
// TODO | ||
const registerThread = ({ name, dependencies }) => { | ||
registry.threads[name] = { name, dependencies } | ||
return registry.threads[name] | ||
} | ||
// update // | ||
@@ -241,4 +239,8 @@ | ||
const applyRemovalDeferrals = () => { | ||
deferredComponentRemovals.forEach(fn => fn()) | ||
deferredEntityRemovals.forEach(fn => fn()) | ||
while(deferredComponentRemovals.length > 0){ | ||
deferredComponentRemovals.shift()() | ||
} | ||
while(deferredEntityRemovals.length > 0){ | ||
deferredEntityRemovals.shift()() | ||
} | ||
} | ||
@@ -245,0 +247,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25852
18
595