reduce update packet size by ~70%
This commit is contained in:
parent
1af386d9f5
commit
0906441246
20 changed files with 219 additions and 143 deletions
|
@ -17,7 +17,9 @@ class Mount {
|
|||
this.traversal = data.traversal ? {
|
||||
cw: data.bounds[0],
|
||||
ccw: data.bounds[1]
|
||||
} : false;
|
||||
} : 0;
|
||||
|
||||
this.updateDeltaInterface();
|
||||
}
|
||||
|
||||
destruct() {
|
||||
|
@ -25,11 +27,20 @@ class Mount {
|
|||
this.fixture.destruct();
|
||||
}
|
||||
|
||||
packDelta() {
|
||||
return [this.traversal || 0];
|
||||
}
|
||||
|
||||
updateDeltaInterface() {
|
||||
this.deltaInterface = this.fixture ? ['traversal'] : [];
|
||||
}
|
||||
|
||||
packFull() {
|
||||
return {
|
||||
x: this.position.x,
|
||||
y: this.position.y
|
||||
}
|
||||
y: this.position.y,
|
||||
turret: this.turret ? this.turret.type : 0
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue