mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-10 01:28:08 +00:00
create alliance request flow
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user