Improve multiplayer

This commit is contained in:
schmelczerandras 2020-10-08 13:16:05 +02:00 committed by Schmelczer András
parent 220b20476f
commit 37954e2ef1
29 changed files with 321 additions and 267 deletions

View file

@ -4,11 +4,11 @@ import { Command } from '../command';
@serializable
export class MoveActionCommand extends Command {
public constructor(public readonly delta: vec2) {
public constructor(public readonly direction: vec2) {
super();
}
public toArray(): Array<any> {
return [this.delta];
return [this.direction];
}
}

View file

@ -0,0 +1,13 @@
import { serializable } from '../../transport/serialization/serializable';
import { Command } from '../command';
@serializable
export class SetAspectRatioActionCommand extends Command {
public constructor(public readonly aspectRatio: number) {
super();
}
public toArray(): Array<any> {
return [this.aspectRatio];
}
}

View file

@ -1,14 +0,0 @@
import { Rectangle } from '../../helper/rectangle';
import { serializable } from '../../transport/serialization/serializable';
import { Command } from '../command';
@serializable
export class SetViewAreaActionCommand extends Command {
public constructor(public readonly viewArea: Rectangle) {
super();
}
public toArray(): Array<any> {
return [this.viewArea];
}
}