Solve serialization
This commit is contained in:
parent
ba8b1a29fd
commit
8e44dd3733
45 changed files with 242 additions and 201 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import { vec2, vec3 } from 'gl-matrix';
|
||||
import { LampBase, settings, id, typeToBaseType } from 'shared';
|
||||
import { LampBase, settings, id, serializable } from 'shared';
|
||||
|
||||
import { ImmutableBoundingBox } from '../physics/bounding-boxes/immutable-bounding-box';
|
||||
|
||||
import { Physical } from '../physics/physical';
|
||||
|
||||
@typeToBaseType
|
||||
@serializable(LampBase)
|
||||
export class LampPhysical extends LampBase implements Physical {
|
||||
public readonly canCollide = false;
|
||||
public readonly isInverted = false;
|
||||
|
|
@ -38,9 +38,4 @@ export class LampPhysical extends LampBase implements Physical {
|
|||
public distance(_: vec2): number {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public toJSON(): any {
|
||||
const { type, id, center, color, lightness } = this;
|
||||
return [type, id, center, color, lightness];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue