Bump dependencies
This commit is contained in:
parent
52ca1b8844
commit
913abb7642
5 changed files with 5721 additions and 19306 deletions
|
|
@ -4,7 +4,10 @@ import { Command } from '../command';
|
|||
|
||||
@serializable
|
||||
export class RemoteCallsForObject {
|
||||
constructor(public readonly id: Id, public readonly calls: Array<RemoteCall>) {}
|
||||
constructor(
|
||||
public readonly id: Id,
|
||||
public readonly calls: Array<RemoteCall>,
|
||||
) {}
|
||||
|
||||
public toArray(): Array<any> {
|
||||
return [this.id, this.calls];
|
||||
|
|
|
|||
|
|
@ -3,7 +3,10 @@ import { serializable } from '../serialization/serializable';
|
|||
|
||||
@serializable
|
||||
export class Circle {
|
||||
constructor(public center: vec2, public radius: number) {}
|
||||
constructor(
|
||||
public center: vec2,
|
||||
public radius: number,
|
||||
) {}
|
||||
|
||||
public distance(target: vec2): number {
|
||||
return vec2.distance(this.center, target) - this.radius;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,10 @@ import { serializable } from '../serialization/serializable';
|
|||
|
||||
@serializable
|
||||
export class Rectangle {
|
||||
constructor(public topLeft = vec2.create(), public size = vec2.create()) {}
|
||||
constructor(
|
||||
public topLeft = vec2.create(),
|
||||
public size = vec2.create(),
|
||||
) {}
|
||||
|
||||
public toArray(): Array<any> {
|
||||
return [this.topLeft, this.size];
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@ import { serializable } from '../serialization/serializable';
|
|||
|
||||
@serializable
|
||||
export class RemoteCall {
|
||||
constructor(public readonly functionName: string, public readonly args: Array<any>) {}
|
||||
constructor(
|
||||
public readonly functionName: string,
|
||||
public readonly args: Array<any>,
|
||||
) {}
|
||||
|
||||
public toArray(): Array<any> {
|
||||
return [this.functionName, this.args];
|
||||
|
|
@ -48,9 +51,9 @@ export abstract class GameObject extends CommandReceiver {
|
|||
|
||||
public processRemoteCalls(remoteCalls: Array<RemoteCall>) {
|
||||
remoteCalls.forEach((r) =>
|
||||
((this[r.functionName as keyof this] as unknown) as (
|
||||
...args: Array<any>
|
||||
) => unknown)(...r.args),
|
||||
(this[r.functionName as keyof this] as unknown as (...args: Array<any>) => unknown)(
|
||||
...r.args,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,12 @@ import { GameObject } from '../game-object';
|
|||
|
||||
@serializable
|
||||
export class LampBase extends GameObject {
|
||||
constructor(id: Id, public center: vec2, public color: vec3, public lightness: number) {
|
||||
constructor(
|
||||
id: Id,
|
||||
public center: vec2,
|
||||
public color: vec3,
|
||||
public lightness: number,
|
||||
) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue