chore: gardening

This commit is contained in:
cha0s 2024-06-27 02:05:10 -05:00
parent 45cb158f2a
commit 929b6a5071
2 changed files with 1 additions and 18 deletions

View File

@ -12,12 +12,10 @@ export default class Component {
constructor(ecs) {
this.ecs = ecs;
this.Instance = this.instanceFromSchema();
}
allocateMany(count) {
if (!this.Instance) {
this.Instance = this.instanceFromSchema();
}
const results = [];
while (count > 0) {
results.push(

View File

@ -329,21 +329,6 @@ export default class Ecs {
this.diff = {};
}
size() {
let size = 0;
// # of components.
size += 2;
for (const type in this.Components) {
size += Schema.sizeOf(type, {type: 'string'});
}
// # of entities.
size += 4;
for (const entityId of this.entities) {
size += this.get(entityId).size();
}
return size;
}
system(systemName) {
return this.Systems[systemName];
}