Improve gameplay
This commit is contained in:
parent
e02a5b264c
commit
7c76b16d13
53 changed files with 1084 additions and 404 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue