mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-20 04:30:08 +00:00
added boat events
This commit is contained in:
@@ -2,6 +2,7 @@ import {info} from "console"
|
||||
import {Config} from "../configuration/Config"
|
||||
import {GameEvent} from "../EventBus"
|
||||
import {ClientID, GameID} from "../Schemas"
|
||||
import {DisplayMessageEvent, MessageType} from "../../client/graphics/layers/EventsDisplay"
|
||||
|
||||
export type PlayerID = string
|
||||
|
||||
@@ -181,6 +182,7 @@ export interface Game {
|
||||
inSpawnPhase(): boolean
|
||||
addExecution(...exec: Execution[]): void
|
||||
config(): Config
|
||||
displayMessage(message: string, type: MessageType): void
|
||||
}
|
||||
|
||||
export interface MutableGame extends Game {
|
||||
|
||||
@@ -9,6 +9,7 @@ import {TileImpl} from "./TileImpl";
|
||||
import {AllianceRequestImpl} from "./AllianceRequestImpl";
|
||||
import {AllianceImpl} from "./AllianceImpl";
|
||||
import {ClientID} from "../Schemas";
|
||||
import {DisplayMessageEvent, MessageType} from "../../client/graphics/layers/EventsDisplay";
|
||||
|
||||
export function createGame(terrainMap: TerrainMap, eventBus: EventBus, config: Config): Game {
|
||||
return new GameImpl(terrainMap, eventBus, config)
|
||||
@@ -338,4 +339,8 @@ export class GameImpl implements MutableGame {
|
||||
this.eventBus.emit(new BrokeAllianceEvent(breaker, other))
|
||||
}
|
||||
|
||||
displayMessage(message: string, type: MessageType): void {
|
||||
this.eventBus.emit(new DisplayMessageEvent(message, type))
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user