perf: tickSynchronized to skip most trait tickers
This commit is contained in:
parent
14a252db3a
commit
c937aae5ef
|
@ -83,7 +83,7 @@ export function Synchronized(Superclass) {
|
|||
return [];
|
||||
}
|
||||
|
||||
tick(elapsed) {
|
||||
tickSynchronized(elapsed) {
|
||||
for (let i = 0; i < this._childrenTickers.length; ++i) {
|
||||
this._childrenTickers[i](elapsed);
|
||||
}
|
||||
|
|
|
@ -177,6 +177,10 @@ export class Layer extends decorate(class {}) {
|
|||
];
|
||||
}
|
||||
|
||||
tick(elapsed) {
|
||||
this.tickSynchronized(elapsed);
|
||||
}
|
||||
|
||||
visibleEntities(query) {
|
||||
return this.entityList.visibleEntities(query);
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ export class Room extends decorate(class {}) {
|
|||
}
|
||||
|
||||
tick(elapsed) {
|
||||
super.tick(elapsed);
|
||||
this.tickSynchronized(elapsed);
|
||||
if (this.world) {
|
||||
this.world.tick(elapsed);
|
||||
}
|
||||
|
|
|
@ -113,6 +113,10 @@ export class Tiles extends decorate(class {}) {
|
|||
];
|
||||
}
|
||||
|
||||
tick(elapsed) {
|
||||
this.tickSynchronized(elapsed);
|
||||
}
|
||||
|
||||
tileAt(x, y) {
|
||||
return this.data.get(y * this.width + x);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user