@javelin/ecs
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -6,2 +6,10 @@ # Change Log | ||
## 0.7.1 (2020-07-06) | ||
**Note:** Version bump only for package @javelin/ecs | ||
# 0.7.0 (2020-06-25) | ||
@@ -8,0 +16,0 @@ |
@@ -8,4 +8,5 @@ export * from "./archetype"; | ||
export * from "./storage"; | ||
export * from "./topic"; | ||
export * from "./util"; | ||
export * from "./world"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -12,4 +12,5 @@ "use strict"; | ||
__export(require("./storage")); | ||
__export(require("./topic")); | ||
__export(require("./util")); | ||
__export(require("./world")); | ||
//# sourceMappingURL=index.js.map |
@@ -122,2 +122,6 @@ "use strict"; | ||
const componentIndex = archetype.layout.indexOf(_t); | ||
if (componentIndex === -1) { | ||
// Entity component makeup does not match patch component. | ||
return false; | ||
} | ||
// Apply patch to component. | ||
@@ -124,0 +128,0 @@ Object.assign(archetype.table[componentIndex][entityIndex], component); |
@@ -1,7 +0,3 @@ | ||
export declare type Topic<T extends string = string, D = any> = { | ||
export declare type Topic<D = unknown> = { | ||
/** | ||
* A property for the name of the topic | ||
*/ | ||
readonly name: T; | ||
/** | ||
* Provides iterator syntax to the consumers of a topic. This will loop | ||
@@ -16,3 +12,3 @@ * through all of the events with the type specified in the second type | ||
*/ | ||
pushEvent(event: D): void; | ||
push(event: D): void; | ||
/** | ||
@@ -30,3 +26,3 @@ * Utility method that cleans the event list in the topic such that at the | ||
*/ | ||
export declare const createTopic: <E>(name: string) => Topic<string, E>; | ||
export declare const createTopic: <E = unknown>() => Topic<E>; | ||
//# sourceMappingURL=topic.d.ts.map |
@@ -8,17 +8,23 @@ "use strict"; | ||
*/ | ||
exports.createTopic = (name) => { | ||
const events = []; | ||
const pushEvent = (event) => { | ||
events.push(event); | ||
}; | ||
exports.createTopic = () => { | ||
const staged = []; | ||
const ready = []; | ||
const push = (event) => staged.push(event); | ||
const flush = () => { | ||
array_1.mutableEmpty(events); | ||
array_1.mutableEmpty(ready); | ||
const len = staged.length; | ||
for (let i = len - 1; i >= 0; i--) { | ||
ready[i] = staged.pop(); | ||
} | ||
}; | ||
return { | ||
name, | ||
[Symbol.iterator]: events.values, | ||
pushEvent, | ||
flush | ||
*[Symbol.iterator]() { | ||
for (let i = 0; i < ready.length; i++) { | ||
yield ready[i]; | ||
} | ||
}, | ||
push, | ||
flush, | ||
}; | ||
}; | ||
//# sourceMappingURL=topic.js.map |
{ | ||
"name": "@javelin/ecs", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"main": "dist/index.js", | ||
@@ -21,3 +21,3 @@ "license": "MIT", | ||
], | ||
"gitHead": "64448ad383f099146f5ebb758712cea239fe7d1f" | ||
"gitHead": "032f4f9a80eee35f0fcfbabbdb8aa7485bd670a6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
90300
1130