refactor: toNetwork
This commit is contained in:
parent
aff492d0f4
commit
4534d0b5ea
|
@ -71,9 +71,7 @@ export class WorldTime extends decorate(class {}) {
|
|||
if (!this._isUpdateReady) {
|
||||
return;
|
||||
}
|
||||
return new WorldTimePacket({
|
||||
hour: this.toNetwork(),
|
||||
});
|
||||
return new WorldTimePacket(this.toNetwork());
|
||||
}
|
||||
|
||||
secondsPerHour() {
|
||||
|
@ -87,13 +85,13 @@ export class WorldTime extends decorate(class {}) {
|
|||
}
|
||||
|
||||
toNetwork() {
|
||||
return (this._hour * MAGIC_TO_FIT_HOUR_INTO_USHORT) >> 0;
|
||||
return {
|
||||
hour: (this._hour * MAGIC_TO_FIT_HOUR_INTO_USHORT) >> 0,
|
||||
};
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
hour: this.toNetwork(),
|
||||
}
|
||||
return this.toNetwork();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user