Fix ide support

This commit is contained in:
schmelczerandras 2020-10-07 18:35:32 +02:00
parent 1a3afe4dd0
commit e01400058d
14 changed files with 50 additions and 20 deletions

View file

@ -8,11 +8,10 @@
"lib"
],
"scripts": {
"build": "webpack --mode production",
"build-before": "npm run build",
"build-before": "npx webpack --mode production",
"initialize": "npm install",
"start": "webpack --mode development --watch",
"try-build-before": "npm run build-before"
"start": "npx webpack --mode development --watch",
"try-build-before": "npx webpack --mode production"
},
"devDependencies": {
"clean-webpack-plugin": "^3.0.0",

View file

@ -0,0 +1,3 @@
export type CommandExecutors = {
[type: string]: (command: any) => unknown;
};

View file

@ -1,9 +1,6 @@
import { CommandExecutors } from './command-executors';
import { Command } from './command';
export type CommandExecutors = {
[type: string]: (command: any) => unknown;
};
export abstract class CommandReceiver {
protected commandExecutors: CommandExecutors = {};

View file

@ -5,6 +5,10 @@ import { serializable } from '../transport/serialization/serializable';
export class Circle {
constructor(public center: vec2, public radius: number) {}
public distance(target: vec2): number {
return vec2.distance(this.center, target) - this.radius;
}
public toArray(): Array<any> {
return [this.center, this.radius];
}

View file

@ -10,6 +10,7 @@ export * from './commands/types/set-view-area-action';
export * from './commands/types/primary-action';
export * from './commands/types/secondary-action';
export * from './commands/command-receiver';
export * from './commands/command-executors';
export * from './commands/command-generator';
export * from './commands/broadcast-commands';
export * from './helper/array';