Improve gameplay

This commit is contained in:
schmelczerandras 2020-10-20 08:56:38 +02:00
parent e02a5b264c
commit 7c76b16d13
53 changed files with 1084 additions and 404 deletions

View file

@ -1,5 +1,14 @@
import { UpdateMessage, UpdateObjectMessage } from '../main';
import { Id } from '../transport/identity';
export abstract class GameObject {
constructor(public readonly id: Id) {}
public calculateUpdates(): UpdateObjectMessage | undefined {
return;
}
update(updates: Array<UpdateMessage>): void {
updates.forEach((u) => ((this as any)[u.key] = u.value));
}
}