Solve serialization

This commit is contained in:
schmelczerandras 2020-10-06 21:33:04 +02:00
parent ba8b1a29fd
commit 8e44dd3733
45 changed files with 242 additions and 201 deletions

View file

@ -1,5 +1,11 @@
import { vec2 } from 'gl-matrix';
import { serializable } from '../transport/serializable/serializable';
@serializable()
export class Circle {
constructor(public center: vec2, public radius: number) {}
constructor(public center: vec2, public radius: number) { }
public toArray(): Array<any> {
return [this.center, this.radius];
}
}

View file

@ -1,5 +1,11 @@
import { vec2 } from 'gl-matrix';
import { serializable } from '../transport/serializable/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];
}
}