Fix some issues
This commit is contained in:
parent
c0a588fb73
commit
1ce961d6c2
27 changed files with 432 additions and 200 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { Command } from '../commands/command';
|
||||
import { Id } from '../transport/identity';
|
||||
import { serializable } from '../transport/serialization/serializable';
|
||||
|
||||
|
|
@ -10,6 +11,39 @@ export class RemoteCall {
|
|||
}
|
||||
}
|
||||
|
||||
@serializable
|
||||
export class UpdateProperty {
|
||||
constructor(
|
||||
public readonly propertyKey: string,
|
||||
public readonly propertyValue: any,
|
||||
public readonly rateOfChange: any,
|
||||
) {}
|
||||
|
||||
public toArray(): Array<any> {
|
||||
return [this.propertyKey, this.propertyValue, this.rateOfChange];
|
||||
}
|
||||
}
|
||||
|
||||
@serializable
|
||||
export class PropertyUpdatesForObject {
|
||||
constructor(public readonly id: Id, public readonly updates: Array<UpdateProperty>) {}
|
||||
|
||||
public toArray(): Array<any> {
|
||||
return [this.id, this.updates];
|
||||
}
|
||||
}
|
||||
|
||||
@serializable
|
||||
export class PropertyUpdatesForObjects extends Command {
|
||||
constructor(public readonly updates: Array<PropertyUpdatesForObject>) {
|
||||
super();
|
||||
}
|
||||
|
||||
public toArray(): Array<any> {
|
||||
return [this.updates];
|
||||
}
|
||||
}
|
||||
|
||||
export abstract class GameObject {
|
||||
private remoteCalls: Array<RemoteCall> = [];
|
||||
|
||||
|
|
@ -23,6 +57,8 @@ export abstract class GameObject {
|
|||
);
|
||||
}
|
||||
|
||||
public getPropertyUpdates(): PropertyUpdatesForObject | void {}
|
||||
|
||||
public getRemoteCalls(): Array<RemoteCall> {
|
||||
return this.remoteCalls;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue