create alliance request flow

This commit is contained in:
evanpelle
2024-09-17 19:43:45 -07:00
parent 149ffaa026
commit 44877b8e59
8 changed files with 141 additions and 13 deletions
+11
View File
@@ -10,6 +10,7 @@ import {TerrainMap} from "../core/TerrainMapLoader";
import {and, bfs, dist, manhattanDist} from "../core/Util";
import {TerrainLayer} from "./graphics/layers/TerrainLayer";
import {WinCheckExecution} from "../core/execution/WinCheckExecution";
import {SendAllianceRequestEvent} from "./graphics/layers/UILayer";
@@ -121,6 +122,7 @@ export class ClientGame {
this.eventBus.on(PlayerEvent, (e) => this.playerEvent(e))
this.eventBus.on(MouseUpEvent, (e) => this.inputEvent(e))
this.eventBus.on(SendAllianceRequestEvent, (e) => this.onSendAllianceRequest(e))
this.renderer.initialize()
this.input.initialize()
@@ -269,6 +271,15 @@ export class ClientGame {
}
}
private onSendAllianceRequest(event: SendAllianceRequestEvent) {
this.sendIntent({
type: "allianceRequest",
clientID: this.id,
requestor: event.requestor.id(),
recipient: event.recipient.id(),
})
}
private sendSpawnIntent(cell: Cell) {
this.sendIntent({
type: "spawn",