base2020/src/index.ts

24 lines
693 B
TypeScript
Raw Normal View History

import { Select } from "./applet/Init";
import { KeyName } from "./applet/Keyboard";
import { BindTests } from "./ecs/test";
import { Data } from "./game/GameComponents";
import { Main } from "./game/Main";
import { LoopbackServer } from "./net/LoopbackServer";
2020-04-05 01:48:50 +00:00
/* // Hot Module Reloading stub, if that's viable
* declare const module: any;
* if(module.hot) {
* const gen = module.hot.data?.gen ?? 0;
* module.hot.accept();
* module.hot.dispose((data: any) => {
* data.gen = gen + 1;
* });
* }
*/
const server = new LoopbackServer<KeyName[], Data>();
Select(".GameCanvas").forEachCanvas((c, cx, keys) => new Main(c, cx, keys, server.socket));
BindTests();