Improve multiplayer
This commit is contained in:
parent
220b20476f
commit
37954e2ef1
29 changed files with 321 additions and 267 deletions
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
13
shared/src/commands/types/set-aspect-ratio-action.ts
Normal file
13
shared/src/commands/types/set-aspect-ratio-action.ts
Normal 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];
|
||||
}
|
||||
}
|
||||
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue