Moved server code to dedicated ServerManager class

This commit is contained in:
Pax1601
2023-09-18 17:10:14 +02:00
parent 2f125e3d0e
commit 44332a2004
9 changed files with 558 additions and 561 deletions

View File

@@ -1,6 +1,5 @@
import { LatLng } from "leaflet";
import { getApp } from "..";
import { spawnExplosion, spawnSmoke } from "../server/server";
import { ContextMenu } from "./contextmenu";
import { Switch } from "../controls/switch";
import { GAME_MASTER } from "../constants/constants";
@@ -48,14 +47,14 @@ export class MapContextMenu extends ContextMenu {
document.addEventListener("contextMenuDeploySmoke", (e: any) => {
this.hide();
spawnSmoke(e.detail.color, this.getLatLng());
getApp().getServerManager().spawnSmoke(e.detail.color, this.getLatLng());
var marker = new SmokeMarker(this.getLatLng(), e.detail.color);
marker.addTo(getApp().getMap());
});
document.addEventListener("contextMenuExplosion", (e: any) => {
this.hide();
spawnExplosion(e.detail.strength, this.getLatLng());
getApp().getServerManager().spawnExplosion(e.detail.strength, this.getLatLng());
});
document.addEventListener("editCoalitionArea", (e: any) => {