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.3.7 to 0.3.8-a

4

dist/index.d.ts
declare module 'bitecs' {
export type Type =
'bool' |
'i8' |

@@ -39,3 +38,2 @@ 'ui8' |

export type ArrayByType = {
['bool']: boolean[];
[Types.i8]: Int8Array;

@@ -76,3 +74,3 @@ [Types.ui8]: Uint8Array;

export type Query = (world: IWorld) => number[]
export type Query = (world: IWorld, clearDiff: Boolean = true) => number[]

@@ -79,0 +77,0 @@ export type System = (world: IWorld) => IWorld

@@ -69,3 +69,3 @@ const TYPES_ENUM = {

const length = store[0].length;
const indexType = length < UNSIGNED_MAX.uint8 ? 'ui8' : length < UNSIGNED_MAX.uint16 ? 'ui16' : 'ui32';
const indexType = length <= UNSIGNED_MAX.uint8 ? 'ui8' : length <= UNSIGNED_MAX.uint16 ? 'ui16' : 'ui32';
const arrayCount = metadata[$storeArrayCounts][type];

@@ -146,3 +146,3 @@ const summedLength = Array(arrayCount).fill(0).reduce((a, p) => a + length, 0); // for threaded impl

const contiguousArray = store => store[$parentArray];
const parentArray = store => store[$parentArray];

@@ -502,3 +502,3 @@ const createArrayStore = (metadata, type, length) => {

const $entityIndices = Symbol('entityIndices');
const NONE$1 = 2 ** 32;
const NONE$1 = 2 ** 32 - 1;
let defaultSize = 100000; // need a global EID cursor which all worlds and all components know about

@@ -594,3 +594,3 @@ // so that world entities can posess entire rows spanning all component tables

const $queryComponents = Symbol('queryComponents');
const NONE = 2 ** 32;
const NONE = 2 ** 32 - 1;
const enterQuery = query => world => {

@@ -655,4 +655,7 @@ if (!world[$queryMap].has(query)) registerQuery(world, query);

return a;
}, {});
const flatProps = components.map(c => Object.getOwnPropertySymbols(c).includes($storeFlattened) ? c[$storeFlattened] : [c]).reduce((a, v) => a.concat(v), []);
}, {}); // const orMasks = notComponents
// .map(mapComponents)
// .reduce(reduceBitmasks, {})
const flatProps = components.filter(c => !c[$tagStore]).map(c => Object.getOwnPropertySymbols(c).includes($storeFlattened) ? c[$storeFlattened] : [c]).reduce((a, v) => a.concat(v), []);
const toRemove = [];

@@ -670,2 +673,3 @@ const entered = [];

notMasks,
// orMasks,
generations,

@@ -743,3 +747,3 @@ indices,

generations
} = world[$queryMap].get(query);
} = world[$queryMap].get(query); // let or = true

@@ -749,3 +753,4 @@ for (let i = 0; i < generations.length; i++) {

const qMask = masks[generationId];
const qNotMask = notMasks[generationId];
const qNotMask = notMasks[generationId]; // const qOrMask = orMasks[generationId]
const eMask = world[$entityMasks][generationId][eid];

@@ -755,4 +760,7 @@

return false;
}
} // if (qOrMask && (eMask & qOrMask) !== qOrMask) {
// continue
// }
if (qMask && (eMask & qMask) !== qMask) {

@@ -781,4 +789,3 @@ return false;

q.entities.push(eid);
q.indices[eid] = q.entities.length - 1; // TODO: pop swap so dupes don't enter
q.indices[eid] = q.entities.length - 1;
q.entered.push(eid);

@@ -815,6 +822,9 @@ };

q.toRemove.push(eid);
world[$dirtyQueries].add(q); // TODO: pop swap so dupes don't enter (in the case where an EID is removed twice before query is called again)
world[$dirtyQueries].add(q);
q.exited.push(eid);
};
const resetChangedQuery = (world, query) => {
const q = world[$queryMap].get(query);
q.changed.length = 0;
};

@@ -995,3 +1005,3 @@ const $componentMap = Symbol('componentMap');

export { Changed, Not, Types, addComponent, addEntity, commitRemovals, contiguousArray, createWorld, defineComponent, defineDeserializer, defineQuery, defineSerializer, defineSystem, enterQuery, exitQuery, hasComponent, pipe, registerComponent, registerComponents, removeComponent, removeEntity, setDefaultSize };
export { Changed, Not, Types, addComponent, addEntity, commitRemovals, createWorld, defineComponent, defineDeserializer, defineQuery, defineSerializer, defineSystem, enterQuery, exitQuery, hasComponent, parentArray, pipe, registerComponent, registerComponents, removeComponent, removeEntity, resetChangedQuery, setDefaultSize };
//# sourceMappingURL=index.es.js.map

@@ -73,3 +73,3 @@ 'use strict';

const length = store[0].length;
const indexType = length < UNSIGNED_MAX.uint8 ? 'ui8' : length < UNSIGNED_MAX.uint16 ? 'ui16' : 'ui32';
const indexType = length <= UNSIGNED_MAX.uint8 ? 'ui8' : length <= UNSIGNED_MAX.uint16 ? 'ui16' : 'ui32';
const arrayCount = metadata[$storeArrayCounts][type];

@@ -150,3 +150,3 @@ const summedLength = Array(arrayCount).fill(0).reduce((a, p) => a + length, 0); // for threaded impl

const contiguousArray = store => store[$parentArray];
const parentArray = store => store[$parentArray];

@@ -506,3 +506,3 @@ const createArrayStore = (metadata, type, length) => {

const $entityIndices = Symbol('entityIndices');
const NONE$1 = 2 ** 32;
const NONE$1 = 2 ** 32 - 1;
let defaultSize = 100000; // need a global EID cursor which all worlds and all components know about

@@ -598,3 +598,3 @@ // so that world entities can posess entire rows spanning all component tables

const $queryComponents = Symbol('queryComponents');
const NONE = 2 ** 32;
const NONE = 2 ** 32 - 1;
const enterQuery = query => world => {

@@ -659,4 +659,7 @@ if (!world[$queryMap].has(query)) registerQuery(world, query);

return a;
}, {});
const flatProps = components.map(c => Object.getOwnPropertySymbols(c).includes($storeFlattened) ? c[$storeFlattened] : [c]).reduce((a, v) => a.concat(v), []);
}, {}); // const orMasks = notComponents
// .map(mapComponents)
// .reduce(reduceBitmasks, {})
const flatProps = components.filter(c => !c[$tagStore]).map(c => Object.getOwnPropertySymbols(c).includes($storeFlattened) ? c[$storeFlattened] : [c]).reduce((a, v) => a.concat(v), []);
const toRemove = [];

@@ -674,2 +677,3 @@ const entered = [];

notMasks,
// orMasks,
generations,

@@ -747,3 +751,3 @@ indices,

generations
} = world[$queryMap].get(query);
} = world[$queryMap].get(query); // let or = true

@@ -753,3 +757,4 @@ for (let i = 0; i < generations.length; i++) {

const qMask = masks[generationId];
const qNotMask = notMasks[generationId];
const qNotMask = notMasks[generationId]; // const qOrMask = orMasks[generationId]
const eMask = world[$entityMasks][generationId][eid];

@@ -759,4 +764,7 @@

return false;
}
} // if (qOrMask && (eMask & qOrMask) !== qOrMask) {
// continue
// }
if (qMask && (eMask & qMask) !== qMask) {

@@ -785,4 +793,3 @@ return false;

q.entities.push(eid);
q.indices[eid] = q.entities.length - 1; // TODO: pop swap so dupes don't enter
q.indices[eid] = q.entities.length - 1;
q.entered.push(eid);

@@ -819,6 +826,9 @@ };

q.toRemove.push(eid);
world[$dirtyQueries].add(q); // TODO: pop swap so dupes don't enter (in the case where an EID is removed twice before query is called again)
world[$dirtyQueries].add(q);
q.exited.push(eid);
};
const resetChangedQuery = (world, query) => {
const q = world[$queryMap].get(query);
q.changed.length = 0;
};

@@ -1005,3 +1015,2 @@ const $componentMap = Symbol('componentMap');

exports.commitRemovals = commitRemovals;
exports.contiguousArray = contiguousArray;
exports.createWorld = createWorld;

@@ -1016,2 +1025,3 @@ exports.defineComponent = defineComponent;

exports.hasComponent = hasComponent;
exports.parentArray = parentArray;
exports.pipe = pipe;

@@ -1022,3 +1032,4 @@ exports.registerComponent = registerComponent;

exports.removeEntity = removeEntity;
exports.resetChangedQuery = resetChangedQuery;
exports.setDefaultSize = setDefaultSize;
//# sourceMappingURL=index.js.map
declare module 'bitecs' {
export type Type =
'bool' |
'i8' |

@@ -39,3 +38,2 @@ 'ui8' |

export type ArrayByType = {
['bool']: boolean[];
[Types.i8]: Int8Array;

@@ -76,3 +74,3 @@ [Types.ui8]: Uint8Array;

export type Query = (world: IWorld) => number[]
export type Query = (world: IWorld, clearDiff: Boolean = true) => number[]

@@ -79,0 +77,0 @@ export type System = (world: IWorld) => IWorld

{
"name": "bitecs",
"version": "0.3.7",
"version": "0.3.8-a",
"description": "Functional, minimal, data-driven, ultra-high performance ECS library written in Javascript",

@@ -5,0 +5,0 @@ "license": "MPL-2.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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