Refactor serialization
This commit is contained in:
parent
8e44dd3733
commit
b3da27e73b
35 changed files with 142 additions and 133 deletions
|
|
@ -6,7 +6,7 @@ import {
|
|||
settings,
|
||||
CommandExecutors,
|
||||
MoveActionCommand,
|
||||
serializable,
|
||||
serializesTo,
|
||||
} from 'shared';
|
||||
|
||||
import { ImmutableBoundingBox } from '../physics/bounding-boxes/immutable-bounding-box';
|
||||
|
|
@ -15,7 +15,7 @@ import { CirclePhysical } from './circle-physical';
|
|||
import { Physical } from '../physics/physical';
|
||||
import { PhysicalContainer } from '../physics/containers/physical-container';
|
||||
|
||||
@serializable(CharacterBase)
|
||||
@serializesTo(CharacterBase)
|
||||
export class CharacterPhysical extends CharacterBase implements Physical {
|
||||
public readonly canCollide = true;
|
||||
public readonly isInverted = false;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {
|
|||
clamp,
|
||||
CommandExecutors,
|
||||
GameObject,
|
||||
serializable,
|
||||
serializesTo,
|
||||
settings,
|
||||
StepCommand,
|
||||
} from 'shared';
|
||||
|
|
@ -15,7 +15,7 @@ import { BoundingBoxBase } from '../physics/bounding-boxes/bounding-box-base';
|
|||
import { moveCircle } from '../physics/move-circle';
|
||||
import { PhysicalContainer } from '../physics/containers/physical-container';
|
||||
|
||||
@serializable(Circle)
|
||||
@serializesTo(Circle)
|
||||
export class CirclePhysical implements Circle, Physical {
|
||||
readonly isInverted = false;
|
||||
readonly canCollide = true;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { vec2, vec3 } from 'gl-matrix';
|
||||
import { LampBase, settings, id, serializable } from 'shared';
|
||||
import { LampBase, settings, id, serializesTo } from 'shared';
|
||||
|
||||
import { ImmutableBoundingBox } from '../physics/bounding-boxes/immutable-bounding-box';
|
||||
|
||||
import { Physical } from '../physics/physical';
|
||||
|
||||
@serializable(LampBase)
|
||||
@serializesTo(LampBase)
|
||||
export class LampPhysical extends LampBase implements Physical {
|
||||
public readonly canCollide = false;
|
||||
public readonly isInverted = false;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { vec2 } from 'gl-matrix';
|
||||
import { clamp01, mix, TunnelBase, id, serializable } from 'shared';
|
||||
import { clamp01, mix, TunnelBase, id, serializesTo } from 'shared';
|
||||
|
||||
import { ImmutableBoundingBox } from '../physics/bounding-boxes/immutable-bounding-box';
|
||||
import { StaticPhysical } from '../physics/containers/static-physical-object';
|
||||
|
||||
@serializable(TunnelBase)
|
||||
@serializesTo(TunnelBase)
|
||||
export class TunnelPhysical extends TunnelBase implements StaticPhysical {
|
||||
public readonly canCollide = true;
|
||||
public readonly isInverted = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue