chore: gardening
This commit is contained in:
parent
45cb158f2a
commit
929b6a5071
|
@ -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(
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user