Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitecs

Package Overview
Dependencies
Maintainers
1
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitecs - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc