mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 07:50:45 +00:00
add prettier import plugin
This commit is contained in:
+3
-1
@@ -1 +1,3 @@
|
||||
{}
|
||||
{
|
||||
"plugins": ["prettier-plugin-organize-imports"]
|
||||
}
|
||||
|
||||
Generated
+18
@@ -96,6 +96,7 @@
|
||||
"postcss": "^8.5.1",
|
||||
"postcss-loader": "^8.1.1",
|
||||
"prettier": "^3.5.0",
|
||||
"prettier-plugin-organize-imports": "^4.1.0",
|
||||
"raw-loader": "^4.0.2",
|
||||
"sinon": "^18.0.0",
|
||||
"sinon-chai": "^4.0.0",
|
||||
@@ -16053,6 +16054,23 @@
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier-plugin-organize-imports": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.1.0.tgz",
|
||||
"integrity": "sha512-5aWRdCgv645xaa58X8lOxzZoiHAldAPChljr/MT0crXVOWTZ+Svl4hIWlz+niYSlO6ikE5UXkN1JrRvIP2ut0A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"prettier": ">=2.0",
|
||||
"typescript": ">=2.9",
|
||||
"vue-tsc": "^2.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"vue-tsc": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/pretty-error": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz",
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
"postcss": "^8.5.1",
|
||||
"postcss-loader": "^8.1.1",
|
||||
"prettier": "^3.5.0",
|
||||
"prettier-plugin-organize-imports": "^4.1.0",
|
||||
"raw-loader": "^4.0.2",
|
||||
"sinon": "^18.0.0",
|
||||
"sinon-chai": "^4.0.0",
|
||||
|
||||
@@ -1,16 +1,32 @@
|
||||
import { Unit, UnitType, TeamName } from "../core/game/Game";
|
||||
import { consolex, initRemoteSender } from "../core/Consolex";
|
||||
import { EventBus } from "../core/EventBus";
|
||||
import { createRenderer, GameRenderer } from "./graphics/GameRenderer";
|
||||
import { InputHandler, MouseUpEvent, MouseMoveEvent } from "./InputHandler";
|
||||
import {
|
||||
ClientID,
|
||||
GameID,
|
||||
ServerMessage,
|
||||
PlayerRecord,
|
||||
GameRecord,
|
||||
GameStartInfo,
|
||||
PlayerRecord,
|
||||
ServerMessage,
|
||||
} from "../core/Schemas";
|
||||
import { createGameRecord } from "../core/Util";
|
||||
import { ServerConfig } from "../core/configuration/Config";
|
||||
import { getConfig } from "../core/configuration/ConfigLoader";
|
||||
import { TeamName, Unit, UnitType } from "../core/game/Game";
|
||||
import { TileRef } from "../core/game/GameMap";
|
||||
import {
|
||||
ErrorUpdate,
|
||||
GameUpdateType,
|
||||
GameUpdateViewData,
|
||||
HashUpdate,
|
||||
WinUpdate,
|
||||
} from "../core/game/GameUpdates";
|
||||
import { GameView, PlayerView, UnitView } from "../core/game/GameView";
|
||||
import { loadTerrainMap } from "../core/game/TerrainMapLoader";
|
||||
import { UserSettings } from "../core/game/UserSettings";
|
||||
import { WorkerClient } from "../core/worker/WorkerClient";
|
||||
import { InputHandler, MouseMoveEvent, MouseUpEvent } from "./InputHandler";
|
||||
import { LocalPersistantStats } from "./LocalPersistantStats";
|
||||
import { getPersistentIDFromCookie } from "./Main";
|
||||
import {
|
||||
SendAttackIntentEvent,
|
||||
SendHashEvent,
|
||||
@@ -18,23 +34,7 @@ import {
|
||||
Transport,
|
||||
} from "./Transport";
|
||||
import { createCanvas } from "./Utils";
|
||||
import {
|
||||
ErrorUpdate,
|
||||
GameUpdateType,
|
||||
HashUpdate,
|
||||
WinUpdate,
|
||||
} from "../core/game/GameUpdates";
|
||||
import { WorkerClient } from "../core/worker/WorkerClient";
|
||||
import { consolex, initRemoteSender } from "../core/Consolex";
|
||||
import { ServerConfig } from "../core/configuration/Config";
|
||||
import { getConfig } from "../core/configuration/ConfigLoader";
|
||||
import { GameView, PlayerView, UnitView } from "../core/game/GameView";
|
||||
import { GameUpdateViewData } from "../core/game/GameUpdates";
|
||||
import { UserSettings } from "../core/game/UserSettings";
|
||||
import { LocalPersistantStats } from "./LocalPersistantStats";
|
||||
import { createGameRecord } from "../core/Util";
|
||||
import { getPersistentIDFromCookie } from "./Main";
|
||||
import { TileRef } from "../core/game/GameMap";
|
||||
import { createRenderer, GameRenderer } from "./graphics/GameRenderer";
|
||||
|
||||
function distSortUnitWorld(tile: TileRef, game: GameView) {
|
||||
return (a: Unit | UnitView, b: Unit | UnitView) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
import { UserSettings } from "../core/game/UserSettings";
|
||||
|
||||
@customElement("dark-mode-button")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
import Countries from "./data/countries.json";
|
||||
import { ModalOverlay } from "./components/ModalOverlay";
|
||||
const flagKey: string = "flag";
|
||||
|
||||
@customElement("flag-input")
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, property } from "lit/decorators.js";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
adsbygoogle: any[];
|
||||
}
|
||||
}
|
||||
import { customElement, property } from "lit/decorators.js";
|
||||
|
||||
/**
|
||||
* Google AdSense integration component
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, query, property, state } from "lit/decorators.js";
|
||||
import { Difficulty, GameMapType, GameMode, GameType } from "../core/game/Game";
|
||||
import { GameConfig, GameInfo } from "../core/Schemas";
|
||||
import { customElement, query, state } from "lit/decorators.js";
|
||||
import randomMap from "../../resources/images/RandomMap.webp";
|
||||
import { translateText } from "../client/Utils";
|
||||
import { getServerConfigFromClient } from "../core/configuration/ConfigLoader";
|
||||
import { consolex } from "../core/Consolex";
|
||||
import "./components/Difficulties";
|
||||
import { Difficulty, GameMapType, GameMode } from "../core/game/Game";
|
||||
import { GameConfig, GameInfo } from "../core/Schemas";
|
||||
import { generateID } from "../core/Util";
|
||||
import "./components/baseComponents/Modal";
|
||||
import "./components/Difficulties";
|
||||
import { DifficultyDescription } from "./components/Difficulties";
|
||||
import "./components/Maps";
|
||||
import randomMap from "../../resources/images/RandomMap.webp";
|
||||
import { generateID } from "../core/Util";
|
||||
import { getServerConfigFromClient } from "../core/configuration/ConfigLoader";
|
||||
import { JoinLobbyEvent } from "./Main";
|
||||
import { translateText } from "../client/Utils";
|
||||
|
||||
@customElement("host-lobby-modal")
|
||||
export class HostLobbyModal extends LitElement {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { EventBus, GameEvent } from "../core/EventBus";
|
||||
import { UserSettings } from "../core/game/UserSettings";
|
||||
import { Game } from "../core/game/Game";
|
||||
import { UnitView } from "../core/game/GameView";
|
||||
import { UserSettings } from "../core/game/UserSettings";
|
||||
|
||||
export class MouseUpEvent implements GameEvent {
|
||||
constructor(
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, query, state } from "lit/decorators.js";
|
||||
import { translateText } from "../client/Utils";
|
||||
import { consolex } from "../core/Consolex";
|
||||
import { GameInfo, GameRecord } from "../core/Schemas";
|
||||
import { generateID } from "../core/Util";
|
||||
import { getServerConfigFromClient } from "../core/configuration/ConfigLoader";
|
||||
import { JoinLobbyEvent } from "./Main";
|
||||
import { translateText } from "../client/Utils";
|
||||
import "./components/baseComponents/Modal";
|
||||
import "./components/baseComponents/Button";
|
||||
import { generateID } from "../core/Util";
|
||||
import "./components/baseComponents/Modal";
|
||||
@customElement("join-private-lobby-modal")
|
||||
export class JoinPrivateLobbyModal extends LitElement {
|
||||
@query("o-modal") private modalEl!: HTMLElement & {
|
||||
|
||||
@@ -2,13 +2,13 @@ import { LitElement, html } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
|
||||
// Import language files
|
||||
import enTranslations from "../../resources/lang/en.json";
|
||||
import bgTranslations from "../../resources/lang/bg.json";
|
||||
import jaTranslations from "../../resources/lang/ja.json";
|
||||
import frTranslations from "../../resources/lang/fr.json";
|
||||
import nlTranslations from "../../resources/lang/nl.json";
|
||||
import deTranslations from "../../resources/lang/de.json";
|
||||
import enTranslations from "../../resources/lang/en.json";
|
||||
import esTranslations from "../../resources/lang/es.json";
|
||||
import frTranslations from "../../resources/lang/fr.json";
|
||||
import jaTranslations from "../../resources/lang/ja.json";
|
||||
import nlTranslations from "../../resources/lang/nl.json";
|
||||
|
||||
const translations = {
|
||||
en: enTranslations,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { consolex } from "../core/Consolex";
|
||||
import { PlayerID } from "../core/game/Game";
|
||||
import { GameConfig, GameID, GameRecord } from "../core/Schemas";
|
||||
|
||||
export interface LocalStatsData {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Config, GameEnv, ServerConfig } from "../core/configuration/Config";
|
||||
import { consolex } from "../core/Consolex";
|
||||
import { GameEvent } from "../core/EventBus";
|
||||
import {
|
||||
AllPlayersStats,
|
||||
ClientMessage,
|
||||
|
||||
+21
-27
@@ -1,38 +1,32 @@
|
||||
import { ClientGameRunner, joinLobby } from "./ClientGameRunner";
|
||||
import favicon from "../../resources/images/Favicon.svg";
|
||||
import "./PublicLobby";
|
||||
import "./components/baseComponents/Button";
|
||||
import "./components/baseComponents/Modal";
|
||||
import "./UsernameInput";
|
||||
import "./styles.css";
|
||||
import { UsernameInput } from "./UsernameInput";
|
||||
import { SinglePlayerModal } from "./SinglePlayerModal";
|
||||
import { HostLobbyModal as HostPrivateLobbyModal } from "./HostLobbyModal";
|
||||
import { JoinPrivateLobbyModal } from "./JoinPrivateLobbyModal";
|
||||
import { GameStartingModal } from "./gameStartingModal";
|
||||
import { generateID } from "../core/Util";
|
||||
import { generateCryptoRandomUUID } from "./Utils";
|
||||
import { consolex } from "../core/Consolex";
|
||||
import "./FlagInput";
|
||||
import { FlagInput } from "./FlagInput";
|
||||
import page from "page";
|
||||
import { PublicLobby } from "./PublicLobby";
|
||||
import favicon from "../../resources/images/Favicon.svg";
|
||||
import { consolex } from "../core/Consolex";
|
||||
import { GameRecord, GameStartInfo } from "../core/Schemas";
|
||||
import { getServerConfigFromClient } from "../core/configuration/ConfigLoader";
|
||||
import { GameType } from "../core/game/Game";
|
||||
import { UserSettings } from "../core/game/UserSettings";
|
||||
import { joinLobby } from "./ClientGameRunner";
|
||||
import "./DarkModeButton";
|
||||
import { DarkModeButton } from "./DarkModeButton";
|
||||
import "./FlagInput";
|
||||
import { FlagInput } from "./FlagInput";
|
||||
import "./GoogleAdElement";
|
||||
import { HelpModal } from "./HelpModal";
|
||||
import { GameType } from "../core/game/Game";
|
||||
import { getServerConfigFromClient } from "../core/configuration/ConfigLoader";
|
||||
import GoogleAdElement from "./GoogleAdElement";
|
||||
import {
|
||||
GameConfig,
|
||||
GameInfo,
|
||||
GameRecord,
|
||||
GameStartInfo,
|
||||
} from "../core/Schemas";
|
||||
import { HelpModal } from "./HelpModal";
|
||||
import { HostLobbyModal as HostPrivateLobbyModal } from "./HostLobbyModal";
|
||||
import { JoinPrivateLobbyModal } from "./JoinPrivateLobbyModal";
|
||||
import "./LangSelector";
|
||||
import { LangSelector } from "./LangSelector";
|
||||
import "./PublicLobby";
|
||||
import { PublicLobby } from "./PublicLobby";
|
||||
import { SinglePlayerModal } from "./SinglePlayerModal";
|
||||
import "./UsernameInput";
|
||||
import { UsernameInput } from "./UsernameInput";
|
||||
import { generateCryptoRandomUUID } from "./Utils";
|
||||
import "./components/baseComponents/Button";
|
||||
import "./components/baseComponents/Modal";
|
||||
import { GameStartingModal } from "./gameStartingModal";
|
||||
import "./styles.css";
|
||||
|
||||
export interface JoinLobbyEvent {
|
||||
clientID: string;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
import { Difficulty, GameMapType, GameType } from "../core/game/Game";
|
||||
import { consolex } from "../core/Consolex";
|
||||
import { getMapsImage } from "./utilities/Maps";
|
||||
import { GameID, GameInfo } from "../core/Schemas";
|
||||
import { translateText } from "../client/Utils";
|
||||
import { JoinLobbyEvent } from "./Main";
|
||||
import { consolex } from "../core/Consolex";
|
||||
import { GameID, GameInfo } from "../core/Schemas";
|
||||
import { generateID } from "../core/Util";
|
||||
import { JoinLobbyEvent } from "./Main";
|
||||
import { getMapsImage } from "./utilities/Maps";
|
||||
|
||||
@customElement("public-lobby")
|
||||
export class PublicLobby extends LitElement {
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, query, state } from "lit/decorators.js";
|
||||
import { Difficulty, GameMapType, GameMode, GameType } from "../core/game/Game";
|
||||
import { generateID as generateID } from "../core/Util";
|
||||
import randomMap from "../../resources/images/RandomMap.webp";
|
||||
import { translateText } from "../client/Utils";
|
||||
import { consolex } from "../core/Consolex";
|
||||
import "./components/Difficulties";
|
||||
import "./components/baseComponents/Modal";
|
||||
import { Difficulty, GameMapType, GameMode, GameType } from "../core/game/Game";
|
||||
import { generateID } from "../core/Util";
|
||||
import "./components/baseComponents/Button";
|
||||
import "./components/baseComponents/Modal";
|
||||
import "./components/Difficulties";
|
||||
import { DifficultyDescription } from "./components/Difficulties";
|
||||
import "./components/Maps";
|
||||
import randomMap from "../../resources/images/RandomMap.webp";
|
||||
import { GameInfo } from "../core/Schemas";
|
||||
import { JoinLobbyEvent } from "./Main";
|
||||
import { translateText } from "../client/Utils";
|
||||
|
||||
@customElement("single-player-modal")
|
||||
export class SinglePlayerModal extends LitElement {
|
||||
|
||||
+6
-11
@@ -1,36 +1,31 @@
|
||||
import { Config, ServerConfig } from "../core/configuration/Config";
|
||||
import { SendLogEvent } from "../core/Consolex";
|
||||
import { EventBus, GameEvent } from "../core/EventBus";
|
||||
import {
|
||||
AllianceRequest,
|
||||
AllPlayers,
|
||||
Cell,
|
||||
GameType,
|
||||
Player,
|
||||
PlayerID,
|
||||
PlayerType,
|
||||
TeamName,
|
||||
Tick,
|
||||
UnitType,
|
||||
} from "../core/game/Game";
|
||||
import { PlayerView } from "../core/game/GameView";
|
||||
import {
|
||||
AllPlayersStats,
|
||||
ClientID,
|
||||
ClientIntentMessageSchema,
|
||||
ClientJoinMessageSchema,
|
||||
GameID,
|
||||
ClientLogMessageSchema,
|
||||
ClientMessageSchema,
|
||||
ClientPingMessageSchema,
|
||||
ClientSendWinnerSchema,
|
||||
Intent,
|
||||
ServerMessage,
|
||||
ServerMessageSchema,
|
||||
ClientPingMessageSchema,
|
||||
GameConfig,
|
||||
ClientLogMessageSchema,
|
||||
ClientSendWinnerSchema,
|
||||
ClientMessageSchema,
|
||||
AllPlayersStats,
|
||||
} from "../core/Schemas";
|
||||
import { LobbyConfig } from "./ClientGameRunner";
|
||||
import { LocalServer } from "./LocalServer";
|
||||
import { PlayerView } from "../core/game/GameView";
|
||||
|
||||
export class PauseGameEvent implements GameEvent {
|
||||
constructor(public readonly paused: boolean) {}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { translateText } from "../client/Utils";
|
||||
import { UserSettings } from "../core/game/UserSettings";
|
||||
import {
|
||||
MAX_USERNAME_LENGTH,
|
||||
validateUsername,
|
||||
} from "../core/validations/username";
|
||||
import { UserSettings } from "../core/game/UserSettings";
|
||||
import { translateText } from "../client/Utils";
|
||||
|
||||
const usernameKey: string = "username";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, property } from "lit/decorators.js";
|
||||
|
||||
export enum DifficultyDescription {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, property } from "lit/decorators.js";
|
||||
import { GameMapType } from "../../core/game/Game";
|
||||
import { getMapsImage } from "../utilities/Maps";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
|
||||
@customElement("modal-overlay")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
|
||||
@customElement("o-modal")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
|
||||
@customElement("game-starting-modal")
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
import { Game, PlayerInfo } from "../../core/game/Game";
|
||||
import { NameLayer } from "./layers/NameLayer";
|
||||
import { TerrainLayer } from "./layers/TerrainLayer";
|
||||
import { TerritoryLayer } from "./layers/TerritoryLayer";
|
||||
import { ClientID } from "../../core/Schemas";
|
||||
import { consolex } from "../../core/Consolex";
|
||||
import { EventBus } from "../../core/EventBus";
|
||||
import { ClientID } from "../../core/Schemas";
|
||||
import { GameView } from "../../core/game/GameView";
|
||||
import { RefreshGraphicsEvent as RedrawGraphicsEvent } from "../InputHandler";
|
||||
import { GameStartingModal } from "../gameStartingModal";
|
||||
import { TransformHandler } from "./TransformHandler";
|
||||
import { Layer } from "./layers/Layer";
|
||||
import { EventsDisplay } from "./layers/EventsDisplay";
|
||||
import { RadialMenu } from "./layers/RadialMenu";
|
||||
import { EmojiTable } from "./layers/EmojiTable";
|
||||
import { Leaderboard } from "./layers/Leaderboard";
|
||||
import { ControlPanel } from "./layers/ControlPanel";
|
||||
import { UIState } from "./UIState";
|
||||
import { BuildMenu } from "./layers/BuildMenu";
|
||||
import { UnitLayer } from "./layers/UnitLayer";
|
||||
import { UILayer } from "./layers/UILayer";
|
||||
import { StructureLayer } from "./layers/StructureLayer";
|
||||
import { PlayerInfoOverlay } from "./layers/PlayerInfoOverlay";
|
||||
import { consolex } from "../../core/Consolex";
|
||||
import { RefreshGraphicsEvent as RedrawGraphicsEvent } from "../InputHandler";
|
||||
import { GameView } from "../../core/game/GameView";
|
||||
import { WinModal } from "./layers/WinModal";
|
||||
import { SpawnTimer } from "./layers/SpawnTimer";
|
||||
import { ControlPanel } from "./layers/ControlPanel";
|
||||
import { EmojiTable } from "./layers/EmojiTable";
|
||||
import { EventsDisplay } from "./layers/EventsDisplay";
|
||||
import { Layer } from "./layers/Layer";
|
||||
import { Leaderboard } from "./layers/Leaderboard";
|
||||
import { NameLayer } from "./layers/NameLayer";
|
||||
import { OptionsMenu } from "./layers/OptionsMenu";
|
||||
import { TopBar } from "./layers/TopBar";
|
||||
import { PlayerInfoOverlay } from "./layers/PlayerInfoOverlay";
|
||||
import { PlayerPanel } from "./layers/PlayerPanel";
|
||||
import { GameStartingModal } from "../gameStartingModal";
|
||||
import { RadialMenu } from "./layers/RadialMenu";
|
||||
import { SpawnTimer } from "./layers/SpawnTimer";
|
||||
import { StructureLayer } from "./layers/StructureLayer";
|
||||
import { TerrainLayer } from "./layers/TerrainLayer";
|
||||
import { TerritoryLayer } from "./layers/TerritoryLayer";
|
||||
import { TopBar } from "./layers/TopBar";
|
||||
import { UILayer } from "./layers/UILayer";
|
||||
import { UnitLayer } from "./layers/UnitLayer";
|
||||
import { WinModal } from "./layers/WinModal";
|
||||
|
||||
export function createRenderer(
|
||||
canvas: HTMLCanvasElement,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Game, Player, Cell } from "../../core/game/Game";
|
||||
import { NameViewData } from "../../core/game/Game";
|
||||
import { calculateBoundingBox, within } from "../../core/Util";
|
||||
import { Cell, Game, NameViewData, Player } from "../../core/game/Game";
|
||||
import { calculateBoundingBox } from "../../core/Util";
|
||||
|
||||
export interface Point {
|
||||
x: number;
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import { colord } from "colord";
|
||||
import { EventBus } from "../../core/EventBus";
|
||||
import { Cell, Game, Player } from "../../core/game/Game";
|
||||
import {
|
||||
calculateBoundingBox,
|
||||
calculateBoundingBoxCenter,
|
||||
} from "../../core/Util";
|
||||
import { ZoomEvent, DragEvent, CenterCameraEvent } from "../InputHandler";
|
||||
import { GoToPlayerEvent, GoToUnitEvent } from "./layers/Leaderboard";
|
||||
import { placeName } from "./NameBoxCalculator";
|
||||
import { Cell } from "../../core/game/Game";
|
||||
import { GameView } from "../../core/game/GameView";
|
||||
import { CenterCameraEvent, DragEvent, ZoomEvent } from "../InputHandler";
|
||||
import { GoToPlayerEvent, GoToUnitEvent } from "./layers/Leaderboard";
|
||||
|
||||
export class TransformHandler {
|
||||
public scale: number = 1.8;
|
||||
|
||||
@@ -1,27 +1,21 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import {
|
||||
Cell,
|
||||
Game,
|
||||
Player,
|
||||
PlayerActions,
|
||||
UnitType,
|
||||
} from "../../../core/game/Game";
|
||||
import { BuildUnitIntentEvent } from "../../Transport";
|
||||
import atomBombIcon from "../../../../resources/images/NukeIconWhite.svg";
|
||||
import hydrogenBombIcon from "../../../../resources/images/MushroomCloudIconWhite.svg";
|
||||
import warshipIcon from "../../../../resources/images/BattleshipIconWhite.svg";
|
||||
import missileSiloIcon from "../../../../resources/images/MissileSiloIconWhite.svg";
|
||||
import goldCoinIcon from "../../../../resources/images/GoldCoinIcon.svg";
|
||||
import portIcon from "../../../../resources/images/PortIcon.svg";
|
||||
import mirvIcon from "../../../../resources/images/MIRVIcon.svg";
|
||||
import cityIcon from "../../../../resources/images/CityIconWhite.svg";
|
||||
import goldCoinIcon from "../../../../resources/images/GoldCoinIcon.svg";
|
||||
import mirvIcon from "../../../../resources/images/MIRVIcon.svg";
|
||||
import missileSiloIcon from "../../../../resources/images/MissileSiloIconWhite.svg";
|
||||
import hydrogenBombIcon from "../../../../resources/images/MushroomCloudIconWhite.svg";
|
||||
import atomBombIcon from "../../../../resources/images/NukeIconWhite.svg";
|
||||
import portIcon from "../../../../resources/images/PortIcon.svg";
|
||||
import samlauncherIcon from "../../../../resources/images/SamLauncherIconWhite.svg";
|
||||
import shieldIcon from "../../../../resources/images/ShieldIconWhite.svg";
|
||||
import { renderNumber } from "../../Utils";
|
||||
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import { Cell, PlayerActions, UnitType } from "../../../core/game/Game";
|
||||
import { TileRef } from "../../../core/game/GameMap";
|
||||
import { GameView } from "../../../core/game/GameView";
|
||||
import { BuildUnitIntentEvent } from "../../Transport";
|
||||
import { renderNumber } from "../../Utils";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
interface BuildItemDisplay {
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
import { Layer } from "./Layer";
|
||||
import { Game } from "../../../core/game/Game";
|
||||
import { ClientID } from "../../../core/Schemas";
|
||||
import { renderNumber, renderTroops } from "../../Utils";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import { UIState } from "../UIState";
|
||||
import { SendSetTargetTroopRatioEvent } from "../../Transport";
|
||||
import { GameView } from "../../../core/game/GameView";
|
||||
import { ClientID } from "../../../core/Schemas";
|
||||
import { AttackRatioEvent } from "../../InputHandler";
|
||||
import { SendSetTargetTroopRatioEvent } from "../../Transport";
|
||||
import { renderNumber, renderTroops } from "../../Utils";
|
||||
import { UIState } from "../UIState";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
@customElement("control-panel")
|
||||
export class ControlPanel extends LitElement implements Layer {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
|
||||
const emojiTable: string[][] = [
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
import { html, LitElement } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
import { DirectiveResult } from "lit/directive.js";
|
||||
import { unsafeHTML, UnsafeHTMLDirective } from "lit/directives/unsafe-html.js";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import {
|
||||
AllPlayers,
|
||||
@@ -9,27 +11,25 @@ import {
|
||||
UnitType,
|
||||
} from "../../../core/game/Game";
|
||||
import {
|
||||
AllianceExpiredUpdate,
|
||||
AllianceRequestReplyUpdate,
|
||||
AllianceRequestUpdate,
|
||||
AttackUpdate,
|
||||
BrokeAllianceUpdate,
|
||||
DisplayMessageUpdate,
|
||||
EmojiUpdate,
|
||||
GameUpdateType,
|
||||
TargetPlayerUpdate,
|
||||
} from "../../../core/game/GameUpdates";
|
||||
import { EmojiUpdate } from "../../../core/game/GameUpdates";
|
||||
import { TargetPlayerUpdate } from "../../../core/game/GameUpdates";
|
||||
import { AllianceExpiredUpdate } from "../../../core/game/GameUpdates";
|
||||
import { BrokeAllianceUpdate } from "../../../core/game/GameUpdates";
|
||||
import { AllianceRequestReplyUpdate } from "../../../core/game/GameUpdates";
|
||||
import { AllianceRequestUpdate } from "../../../core/game/GameUpdates";
|
||||
import { GameUpdateType } from "../../../core/game/GameUpdates";
|
||||
import { ClientID } from "../../../core/Schemas";
|
||||
import { Layer } from "./Layer";
|
||||
import {
|
||||
CancelAttackIntentEvent,
|
||||
SendAllianceReplyIntentEvent,
|
||||
} from "../../Transport";
|
||||
import { unsafeHTML, UnsafeHTMLDirective } from "lit/directives/unsafe-html.js";
|
||||
import { DirectiveResult } from "lit/directive.js";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
import { onlyImages, sanitize } from "../../../core/Util";
|
||||
import { GameView, PlayerView, UnitView } from "../../../core/game/GameView";
|
||||
import { onlyImages } from "../../../core/Util";
|
||||
import { renderTroops } from "../../Utils";
|
||||
import { GoToPlayerEvent, GoToUnitEvent } from "./Leaderboard";
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { Game } from "../../../core/game/Game";
|
||||
|
||||
export interface Layer {
|
||||
init?();
|
||||
tick?();
|
||||
|
||||
@@ -1,29 +1,19 @@
|
||||
import {
|
||||
AllPlayers,
|
||||
Cell,
|
||||
Game,
|
||||
NukeType,
|
||||
nukeTypes,
|
||||
Player,
|
||||
PlayerType,
|
||||
UnitType,
|
||||
} from "../../../core/game/Game";
|
||||
import { PseudoRandom } from "../../../core/PseudoRandom";
|
||||
import { Theme } from "../../../core/configuration/Config";
|
||||
import { Layer } from "./Layer";
|
||||
import { TransformHandler } from "../TransformHandler";
|
||||
import traitorIcon from "../../../../resources/images/TraitorIcon.svg";
|
||||
import allianceIcon from "../../../../resources/images/AllianceIcon.svg";
|
||||
import allianceRequestIcon from "../../../../resources/images/AllianceRequestIcon.svg";
|
||||
import crownIcon from "../../../../resources/images/CrownIcon.svg";
|
||||
import targetIcon from "../../../../resources/images/TargetIcon.svg";
|
||||
import embargoIcon from "../../../../resources/images/EmbargoIcon.svg";
|
||||
import nukeWhiteIcon from "../../../../resources/images/NukeIconWhite.svg";
|
||||
import nukeRedIcon from "../../../../resources/images/NukeIconRed.svg";
|
||||
import nukeWhiteIcon from "../../../../resources/images/NukeIconWhite.svg";
|
||||
import targetIcon from "../../../../resources/images/TargetIcon.svg";
|
||||
import traitorIcon from "../../../../resources/images/TraitorIcon.svg";
|
||||
import { PseudoRandom } from "../../../core/PseudoRandom";
|
||||
import { ClientID } from "../../../core/Schemas";
|
||||
import { Theme } from "../../../core/configuration/Config";
|
||||
import { AllPlayers, Cell, nukeTypes } from "../../../core/game/Game";
|
||||
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||
import { createCanvas, renderTroops } from "../../Utils";
|
||||
import { sanitize } from "../../../core/Util";
|
||||
import { TransformHandler } from "../TransformHandler";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
class RenderInfo {
|
||||
public icons: Map<string, HTMLImageElement> = new Map(); // Track icon elements
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import { PauseGameEvent } from "../../Transport";
|
||||
import { GameType } from "../../../core/game/Game";
|
||||
import { GameView } from "../../../core/game/GameView";
|
||||
import { Layer } from "./Layer";
|
||||
import { GameUpdateType } from "../../../core/game/GameUpdates";
|
||||
import { GameView } from "../../../core/game/GameView";
|
||||
import { UserSettings } from "../../../core/game/UserSettings";
|
||||
import { AlternateViewEvent, RefreshGraphicsEvent } from "../../InputHandler";
|
||||
import { PauseGameEvent } from "../../Transport";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
const button = ({
|
||||
classes = "",
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
import { Layer } from "./Layer";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import {
|
||||
Game,
|
||||
GameType,
|
||||
Player,
|
||||
PlayerProfile,
|
||||
PlayerType,
|
||||
Relation,
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../../../core/game/Game";
|
||||
import { ClientID } from "../../../core/Schemas";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import { TransformHandler } from "../TransformHandler";
|
||||
import { MouseMoveEvent } from "../../InputHandler";
|
||||
import { GameView, PlayerView, UnitView } from "../../../core/game/GameView";
|
||||
import { TileRef } from "../../../core/game/GameMap";
|
||||
import { GameView, PlayerView, UnitView } from "../../../core/game/GameView";
|
||||
import { ClientID } from "../../../core/Schemas";
|
||||
import { MouseMoveEvent } from "../../InputHandler";
|
||||
import { renderNumber, renderTroops } from "../../Utils";
|
||||
import { TransformHandler } from "../TransformHandler";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
function euclideanDistWorld(
|
||||
coord: { x: number; y: number },
|
||||
|
||||
@@ -1,34 +1,33 @@
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
import allianceIcon from "../../../../resources/images/AllianceIconWhite.svg";
|
||||
import donateGoldIcon from "../../../../resources/images/DonateGoldIconWhite.svg";
|
||||
import donateTroopIcon from "../../../../resources/images/DonateTroopIconWhite.svg";
|
||||
import emojiIcon from "../../../../resources/images/EmojiIconWhite.svg";
|
||||
import targetIcon from "../../../../resources/images/TargetIconWhite.svg";
|
||||
import traitorIcon from "../../../../resources/images/TraitorIconWhite.svg";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||
import { Layer } from "./Layer";
|
||||
import { MouseUpEvent } from "../../InputHandler";
|
||||
import {
|
||||
AllPlayers,
|
||||
Player,
|
||||
PlayerActions,
|
||||
PlayerID,
|
||||
UnitType,
|
||||
} from "../../../core/game/Game";
|
||||
import { TileRef } from "../../../core/game/GameMap";
|
||||
import { renderNumber, renderTroops } from "../../Utils";
|
||||
import targetIcon from "../../../../resources/images/TargetIconWhite.svg";
|
||||
import emojiIcon from "../../../../resources/images/EmojiIconWhite.svg";
|
||||
import donateTroopIcon from "../../../../resources/images/DonateTroopIconWhite.svg";
|
||||
import donateGoldIcon from "../../../../resources/images/DonateGoldIconWhite.svg";
|
||||
import traitorIcon from "../../../../resources/images/TraitorIconWhite.svg";
|
||||
import allianceIcon from "../../../../resources/images/AllianceIconWhite.svg";
|
||||
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||
import { MouseUpEvent } from "../../InputHandler";
|
||||
import {
|
||||
SendAllianceRequestIntentEvent,
|
||||
SendBreakAllianceIntentEvent,
|
||||
SendDonateGoldIntentEvent,
|
||||
SendDonateTroopsIntentEvent,
|
||||
SendEmbargoIntentEvent,
|
||||
SendEmojiIntentEvent,
|
||||
SendTargetPlayerIntentEvent,
|
||||
SendEmbargoIntentEvent,
|
||||
} from "../../Transport";
|
||||
import { renderNumber, renderTroops } from "../../Utils";
|
||||
import { EmojiTable } from "./EmojiTable";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
@customElement("player-panel")
|
||||
export class PlayerPanel extends LitElement implements Layer {
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import * as d3 from "d3";
|
||||
import boatIcon from "../../../../resources/images/BoatIconWhite.svg";
|
||||
import buildIcon from "../../../../resources/images/BuildIconWhite.svg";
|
||||
import disabledIcon from "../../../../resources/images/DisabledIcon.svg";
|
||||
import infoIcon from "../../../../resources/images/InfoIcon.svg";
|
||||
import swordIcon from "../../../../resources/images/SwordIconWhite.svg";
|
||||
import xIcon from "../../../../resources/images/XIcon.svg";
|
||||
import { consolex } from "../../../core/Consolex";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import {
|
||||
AllPlayers,
|
||||
Cell,
|
||||
Game,
|
||||
Player,
|
||||
PlayerActions,
|
||||
} from "../../../core/game/Game";
|
||||
import { Cell, PlayerActions } from "../../../core/game/Game";
|
||||
import { TileRef } from "../../../core/game/GameMap";
|
||||
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||
import { ClientID } from "../../../core/Schemas";
|
||||
import {
|
||||
CloseViewEvent,
|
||||
@@ -14,36 +18,15 @@ import {
|
||||
ShowBuildMenuEvent,
|
||||
} from "../../InputHandler";
|
||||
import {
|
||||
SendAllianceRequestIntentEvent,
|
||||
SendAttackIntentEvent,
|
||||
SendBoatAttackIntentEvent,
|
||||
SendBreakAllianceIntentEvent,
|
||||
SendDonateTroopsIntentEvent,
|
||||
SendDonateGoldIntentEvent,
|
||||
SendEmojiIntentEvent,
|
||||
SendSpawnIntentEvent,
|
||||
SendTargetPlayerIntentEvent,
|
||||
} from "../../Transport";
|
||||
import { TransformHandler } from "../TransformHandler";
|
||||
import { Layer } from "./Layer";
|
||||
import * as d3 from "d3";
|
||||
import traitorIcon from "../../../../resources/images/TraitorIconWhite.svg";
|
||||
import allianceIcon from "../../../../resources/images/AllianceIconWhite.svg";
|
||||
import boatIcon from "../../../../resources/images/BoatIconWhite.svg";
|
||||
import swordIcon from "../../../../resources/images/SwordIconWhite.svg";
|
||||
import infoIcon from "../../../../resources/images/InfoIcon.svg";
|
||||
import targetIcon from "../../../../resources/images/TargetIconWhite.svg";
|
||||
import emojiIcon from "../../../../resources/images/EmojiIconWhite.svg";
|
||||
import disabledIcon from "../../../../resources/images/DisabledIcon.svg";
|
||||
import xIcon from "../../../../resources/images/XIcon.svg";
|
||||
import donateIcon from "../../../../resources/images/DonateIconWhite.svg";
|
||||
import buildIcon from "../../../../resources/images/BuildIconWhite.svg";
|
||||
import { EmojiTable } from "./EmojiTable";
|
||||
import { UIState } from "../UIState";
|
||||
import { BuildMenu } from "./BuildMenu";
|
||||
import { consolex } from "../../../core/Consolex";
|
||||
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||
import { TileRef } from "../../../core/game/GameMap";
|
||||
import { EmojiTable } from "./EmojiTable";
|
||||
import { Layer } from "./Layer";
|
||||
import { PlayerInfoOverlay } from "./PlayerInfoOverlay";
|
||||
import { PlayerPanel } from "./PlayerPanel";
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
import { colord, Colord } from "colord";
|
||||
import { Theme } from "../../../core/configuration/Config";
|
||||
import { Layer } from "./Layer";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
import anchorIcon from "../../../../resources/images/buildings/port1.png";
|
||||
import missileSiloIcon from "../../../../resources/images/buildings/silo1.png";
|
||||
import SAMMissileIcon from "../../../../resources/images/buildings/silo4.png";
|
||||
import SAMMissileReloadingIcon from "../../../../resources/images/buildings/silo4-reloading.png";
|
||||
import MissileSiloReloadingIcon from "../../../../resources/images/buildings/silo1-reloading.png";
|
||||
import shieldIcon from "../../../../resources/images/buildings/fortAlt2.png";
|
||||
import cityIcon from "../../../../resources/images/buildings/cityAlt1.png";
|
||||
import { GameView, UnitView } from "../../../core/game/GameView";
|
||||
import shieldIcon from "../../../../resources/images/buildings/fortAlt2.png";
|
||||
import anchorIcon from "../../../../resources/images/buildings/port1.png";
|
||||
import MissileSiloReloadingIcon from "../../../../resources/images/buildings/silo1-reloading.png";
|
||||
import missileSiloIcon from "../../../../resources/images/buildings/silo1.png";
|
||||
import SAMMissileReloadingIcon from "../../../../resources/images/buildings/silo4-reloading.png";
|
||||
import SAMMissileIcon from "../../../../resources/images/buildings/silo4.png";
|
||||
import { Cell, UnitType } from "../../../core/game/Game";
|
||||
import { GameUpdateType } from "../../../core/game/GameUpdates";
|
||||
import {
|
||||
euclDistFN,
|
||||
hexDistFN,
|
||||
manhattanDistFN,
|
||||
rectDistFN,
|
||||
hexDistFN,
|
||||
} from "../../../core/game/GameMap";
|
||||
import { GameUpdateType } from "../../../core/game/GameUpdates";
|
||||
import { GameView, UnitView } from "../../../core/game/GameView";
|
||||
|
||||
const underConstructionColor = colord({ r: 150, g: 150, b: 150 });
|
||||
const reloadingColor = colord({ r: 255, g: 0, b: 0 });
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Layer } from "./Layer";
|
||||
import { GameView } from "../../../core/game/GameView";
|
||||
import { Theme } from "../../../core/configuration/Config";
|
||||
import { GameView } from "../../../core/game/GameView";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
export class TerrainLayer implements Layer {
|
||||
private canvas: HTMLCanvasElement;
|
||||
|
||||
@@ -1,29 +1,18 @@
|
||||
import { PriorityQueue } from "@datastructures-js/priority-queue";
|
||||
import {
|
||||
Cell,
|
||||
Game,
|
||||
Player,
|
||||
PlayerType,
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../../../core/game/Game";
|
||||
import { GameUpdateType, UnitUpdate } from "../../../core/game/GameUpdates";
|
||||
import { PseudoRandom } from "../../../core/PseudoRandom";
|
||||
import { colord, Colord } from "colord";
|
||||
import { Colord } from "colord";
|
||||
import { Theme } from "../../../core/configuration/Config";
|
||||
import { Layer } from "./Layer";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import {
|
||||
AlternateViewEvent,
|
||||
DragEvent,
|
||||
MouseDownEvent,
|
||||
} from "../../InputHandler";
|
||||
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||
import { Cell, PlayerType, UnitType } from "../../../core/game/Game";
|
||||
import {
|
||||
euclDistFN,
|
||||
manhattanDistFN,
|
||||
TileRef,
|
||||
} from "../../../core/game/GameMap";
|
||||
import { GameUpdateType, UnitUpdate } from "../../../core/game/GameUpdates";
|
||||
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||
import { PseudoRandom } from "../../../core/PseudoRandom";
|
||||
import { AlternateViewEvent, DragEvent } from "../../InputHandler";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
export class TerritoryLayer implements Layer {
|
||||
private canvas: HTMLCanvasElement;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { LitElement, html } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
import { customElement } from "lit/decorators.js";
|
||||
import { GameView } from "../../../core/game/GameView";
|
||||
import { Layer } from "./Layer";
|
||||
import { renderNumber, renderTroops } from "../../Utils";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
@customElement("top-bar")
|
||||
export class TopBar extends LitElement implements Layer {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Colord } from "colord";
|
||||
import { Theme } from "../../../core/configuration/Config";
|
||||
import { UnitType } from "../../../core/game/Game";
|
||||
import { Layer } from "./Layer";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import { ClientID } from "../../../core/Schemas";
|
||||
import { Theme } from "../../../core/configuration/Config";
|
||||
import { UnitType } from "../../../core/game/Game";
|
||||
import { GameView, UnitView } from "../../../core/game/GameView";
|
||||
import { UnitSelectionEvent } from "../../InputHandler";
|
||||
import { TransformHandler } from "../TransformHandler";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
/**
|
||||
* Layer responsible for drawing UI elements that overlay the game
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
import { colord, Colord } from "colord";
|
||||
import { Theme } from "../../../core/configuration/Config";
|
||||
import { Unit, UnitType, Player } from "../../../core/game/Game";
|
||||
import { Layer } from "./Layer";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import {
|
||||
AlternateViewEvent,
|
||||
MouseUpEvent,
|
||||
UnitSelectionEvent,
|
||||
} from "../../InputHandler";
|
||||
import { ClientID } from "../../../core/Schemas";
|
||||
import { GameView, PlayerView, UnitView } from "../../../core/game/GameView";
|
||||
import { Theme } from "../../../core/configuration/Config";
|
||||
import { UnitType } from "../../../core/game/Game";
|
||||
import {
|
||||
euclDistFN,
|
||||
manhattanDistFN,
|
||||
TileRef,
|
||||
} from "../../../core/game/GameMap";
|
||||
import { GameUpdateType } from "../../../core/game/GameUpdates";
|
||||
import { TransformHandler } from "../TransformHandler";
|
||||
import { GameView, PlayerView, UnitView } from "../../../core/game/GameView";
|
||||
import {
|
||||
AlternateViewEvent,
|
||||
MouseUpEvent,
|
||||
UnitSelectionEvent,
|
||||
} from "../../InputHandler";
|
||||
import { MoveWarshipIntentEvent } from "../../Transport";
|
||||
import { TransformHandler } from "../TransformHandler";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
enum Relationship {
|
||||
Self,
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
import { Player, TeamName } from "../../../core/game/Game";
|
||||
import { ClientID } from "../../../core/Schemas";
|
||||
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||
import { Layer } from "./Layer";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import { TeamName } from "../../../core/game/Game";
|
||||
import { GameUpdateType } from "../../../core/game/GameUpdates";
|
||||
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||
import { PseudoRandom } from "../../../core/PseudoRandom";
|
||||
import { simpleHash } from "../../../core/Util";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import { SendWinnerEvent } from "../../Transport";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
// Add this at the top of your file
|
||||
declare global {
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import world from "../../../resources/maps/WorldMapThumb.webp";
|
||||
import oceania from "../../../resources/maps/OceaniaThumb.webp";
|
||||
import europe from "../../../resources/maps/EuropeThumb.webp";
|
||||
import mena from "../../../resources/maps/MenaThumb.webp";
|
||||
import northAmerica from "../../../resources/maps/NorthAmericaThumb.webp";
|
||||
import southAmerica from "../../../resources/maps/SouthAmericaThumb.webp";
|
||||
import blackSea from "../../../resources/maps/BlackSeaThumb.webp";
|
||||
import africa from "../../../resources/maps/AfricaThumb.webp";
|
||||
import pangaea from "../../../resources/maps/PangaeaThumb.webp";
|
||||
import asia from "../../../resources/maps/AsiaThumb.webp";
|
||||
import mars from "../../../resources/maps/MarsThumb.webp";
|
||||
import britannia from "../../../resources/maps/BritanniaThumb.webp";
|
||||
import gatewayToTheAtlantic from "../../../resources/maps/GatewayToTheAtlanticThumb.webp";
|
||||
import australia from "../../../resources/maps/AustraliaThumb.webp";
|
||||
import blackSea from "../../../resources/maps/BlackSeaThumb.webp";
|
||||
import britannia from "../../../resources/maps/BritanniaThumb.webp";
|
||||
import europe from "../../../resources/maps/EuropeThumb.webp";
|
||||
import gatewayToTheAtlantic from "../../../resources/maps/GatewayToTheAtlanticThumb.webp";
|
||||
import iceland from "../../../resources/maps/IcelandThumb.webp";
|
||||
import japan from "../../../resources/maps/JapanThumb.webp";
|
||||
import mars from "../../../resources/maps/MarsThumb.webp";
|
||||
import mena from "../../../resources/maps/MenaThumb.webp";
|
||||
import northAmerica from "../../../resources/maps/NorthAmericaThumb.webp";
|
||||
import oceania from "../../../resources/maps/OceaniaThumb.webp";
|
||||
import pangaea from "../../../resources/maps/PangaeaThumb.webp";
|
||||
import southAmerica from "../../../resources/maps/SouthAmericaThumb.webp";
|
||||
import world from "../../../resources/maps/WorldMapThumb.webp";
|
||||
|
||||
import { GameMapType } from "../../core/game/Game";
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { utcDay } from "d3";
|
||||
import { placeName } from "../client/graphics/NameBoxCalculator";
|
||||
import { getConfig } from "./configuration/ConfigLoader";
|
||||
import { EventBus } from "./EventBus";
|
||||
import { Executor } from "./execution/ExecutionManager";
|
||||
import { WinCheckExecution } from "./execution/WinCheckExecution";
|
||||
import {
|
||||
@@ -9,22 +7,24 @@ import {
|
||||
BuildableUnit,
|
||||
Game,
|
||||
GameUpdates,
|
||||
NameViewData,
|
||||
Player,
|
||||
PlayerActions,
|
||||
PlayerID,
|
||||
PlayerProfile,
|
||||
PlayerBorderTiles,
|
||||
PlayerID,
|
||||
PlayerInfo,
|
||||
PlayerProfile,
|
||||
PlayerType,
|
||||
UnitType,
|
||||
PlayerInfo,
|
||||
} from "./game/Game";
|
||||
import { ErrorUpdate } from "./game/GameUpdates";
|
||||
import { NameViewData } from "./game/Game";
|
||||
import { GameUpdateType } from "./game/GameUpdates";
|
||||
import { createGame } from "./game/GameImpl";
|
||||
import {
|
||||
ErrorUpdate,
|
||||
GameUpdateType,
|
||||
GameUpdateViewData,
|
||||
} from "./game/GameUpdates";
|
||||
import { loadTerrainMap as loadGameMap } from "./game/TerrainMapLoader";
|
||||
import { ClientID, GameStartInfo, Turn } from "./Schemas";
|
||||
import { GameUpdateViewData } from "./game/GameUpdates";
|
||||
|
||||
export async function createGameRunner(
|
||||
gameStart: GameStartInfo,
|
||||
|
||||
+3
-6
@@ -1,20 +1,17 @@
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import twemoji from "twemoji";
|
||||
import DOMPurify from "dompurify";
|
||||
import { customAlphabet } from "nanoid";
|
||||
import twemoji from "twemoji";
|
||||
import { Cell, Game, Player, TeamName, Unit } from "./game/Game";
|
||||
import { andFN, GameMap, manhattanDistFN, TileRef } from "./game/GameMap";
|
||||
import {
|
||||
AllPlayersStats,
|
||||
ClientID,
|
||||
GameConfig,
|
||||
GameID,
|
||||
GameRecord,
|
||||
GameStartInfo,
|
||||
PlayerRecord,
|
||||
PlayerStats,
|
||||
Turn,
|
||||
} from "./Schemas";
|
||||
import { customAlphabet, nanoid } from "nanoid";
|
||||
import { andFN, GameMap, manhattanDistFN, TileRef } from "./game/GameMap";
|
||||
|
||||
export function manhattanDistWrapped(
|
||||
c1: Cell,
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
import { Colord } from "colord";
|
||||
import { GameConfig, GameID } from "../Schemas";
|
||||
import {
|
||||
Difficulty,
|
||||
Game,
|
||||
GameMapType,
|
||||
Gold,
|
||||
Player,
|
||||
PlayerID,
|
||||
PlayerInfo,
|
||||
TerraNullius,
|
||||
Tick,
|
||||
Unit,
|
||||
UnitInfo,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { Colord, colord } from "colord";
|
||||
import { GameConfig, GameID } from "../Schemas";
|
||||
import { GameMap, TileRef } from "../game/GameMap";
|
||||
import { PlayerView } from "../game/GameView";
|
||||
import { UserSettings } from "../game/UserSettings";
|
||||
|
||||
@@ -10,11 +10,10 @@ import {
|
||||
TerrainType,
|
||||
TerraNullius,
|
||||
Tick,
|
||||
Unit,
|
||||
UnitInfo,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { GameMap, TileRef } from "../game/GameMap";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PlayerView } from "../game/GameView";
|
||||
import { UserSettings } from "../game/UserSettings";
|
||||
import { GameConfig, GameID } from "../Schemas";
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Colord, colord, random } from "colord";
|
||||
import { PlayerType, TeamName, TerrainType } from "../game/Game";
|
||||
import { Theme } from "./Config";
|
||||
import { Colord, colord } from "colord";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { simpleHash } from "../Util";
|
||||
import { PlayerType, TeamName, TerrainType } from "../game/Game";
|
||||
import { GameMap, TileRef } from "../game/GameMap";
|
||||
import { PlayerView } from "../game/GameView";
|
||||
import {
|
||||
@@ -13,6 +12,7 @@ import {
|
||||
red,
|
||||
territoryColors,
|
||||
} from "./Colors";
|
||||
import { Theme } from "./Config";
|
||||
|
||||
export const pastelTheme = new (class implements Theme {
|
||||
private rand = new PseudoRandom(123);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Colord, colord, random } from "colord";
|
||||
import { PlayerType, TeamName, TerrainType } from "../game/Game";
|
||||
import { Theme } from "./Config";
|
||||
import { Colord, colord } from "colord";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { simpleHash } from "../Util";
|
||||
import { PlayerType, TeamName, TerrainType } from "../game/Game";
|
||||
import { GameMap, TileRef } from "../game/GameMap";
|
||||
import { PlayerView } from "../game/GameView";
|
||||
import {
|
||||
@@ -13,6 +12,7 @@ import {
|
||||
red,
|
||||
territoryColors,
|
||||
} from "./Colors";
|
||||
import { Theme } from "./Config";
|
||||
|
||||
export const pastelThemeDark = new (class implements Theme {
|
||||
private rand = new PseudoRandom(123);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { GameEnv } from "./Config";
|
||||
import { DefaultConfig, DefaultServerConfig } from "./DefaultConfig";
|
||||
import { DefaultServerConfig } from "./DefaultConfig";
|
||||
|
||||
export const preprodConfig = new (class extends DefaultServerConfig {
|
||||
r2Bucket(): string {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { GameEnv } from "./Config";
|
||||
import { DefaultConfig, DefaultServerConfig } from "./DefaultConfig";
|
||||
import { DefaultServerConfig } from "./DefaultConfig";
|
||||
|
||||
export const prodConfig = new (class extends DefaultServerConfig {
|
||||
r2Bucket(): string {
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import { PriorityQueue } from "@datastructures-js/priority-queue";
|
||||
import { renderNumber, renderTroops } from "../../client/Utils";
|
||||
import {
|
||||
Attack,
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
MessageType,
|
||||
Player,
|
||||
PlayerID,
|
||||
PlayerType,
|
||||
TerrainType,
|
||||
TerraNullius,
|
||||
} from "../game/Game";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { MessageType } from "../game/Game";
|
||||
import { renderNumber, renderTroops } from "../../client/Utils";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
|
||||
const malusForRetreat = 25;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import { Cell, Game, PlayerInfo, PlayerType } from "../game/Game";
|
||||
import { Game, PlayerInfo, PlayerType } from "../game/Game";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { GameID, SpawnIntent } from "../Schemas";
|
||||
import { GameID } from "../Schemas";
|
||||
import { simpleHash } from "../Util";
|
||||
import { SpawnExecution } from "./SpawnExecution";
|
||||
import { BOT_NAME_PREFIXES, BOT_NAME_SUFFIXES } from "./utils/BotNames";
|
||||
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
Unit,
|
||||
PlayerID,
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
Unit,
|
||||
PlayerID,
|
||||
UnitType,
|
||||
Tick,
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { CityExecution } from "./CityExecution";
|
||||
import { DefensePostExecution } from "./DefensePostExecution";
|
||||
import { SAMLauncherExecution } from "./SAMLauncherExecution";
|
||||
import { MirvExecution } from "./MIRVExecution";
|
||||
import { MissileSiloExecution } from "./MissileSiloExecution";
|
||||
import { NukeExecution } from "./NukeExecution";
|
||||
import { PortExecution } from "./PortExecution";
|
||||
import { SAMLauncherExecution } from "./SAMLauncherExecution";
|
||||
import { WarshipExecution } from "./WarshipExecution";
|
||||
|
||||
export class ConstructionExecution implements Execution {
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
Unit,
|
||||
PlayerID,
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { manhattanDistFN, TileRef } from "../game/GameMap";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
|
||||
export class DefensePostExecution implements Execution {
|
||||
private player: Player;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import { Execution, Game, Player, PlayerID, Gold } from "../game/Game";
|
||||
import { Execution, Game, Player, PlayerID } from "../game/Game";
|
||||
|
||||
export class DonateGoldExecution implements Execution {
|
||||
private sender: Player;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import { Execution, Game, Player, PlayerID, Gold } from "../game/Game";
|
||||
import { Execution, Game, Player, PlayerID } from "../game/Game";
|
||||
|
||||
export class DonateTroopsExecution implements Execution {
|
||||
private sender: Player;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import { Execution, Game, Player, PlayerID } from "../game/Game";
|
||||
|
||||
export class EmbargoExecution implements Execution {
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
Player,
|
||||
PlayerID,
|
||||
PlayerType,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
|
||||
export class EmojiExecution implements Execution {
|
||||
|
||||
@@ -1,43 +1,26 @@
|
||||
import {
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
PlayerInfo,
|
||||
TerraNullius,
|
||||
PlayerType,
|
||||
Alliance,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import {
|
||||
AttackIntent,
|
||||
BoatAttackIntentSchema,
|
||||
ClientID,
|
||||
GameID,
|
||||
Intent,
|
||||
Turn,
|
||||
} from "../Schemas";
|
||||
import { AttackExecution } from "./AttackExecution";
|
||||
import { SpawnExecution } from "./SpawnExecution";
|
||||
import { BotSpawner } from "./BotSpawner";
|
||||
import { TransportShipExecution } from "./TransportShipExecution";
|
||||
import { Execution, Game, PlayerInfo, PlayerType } from "../game/Game";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { FakeHumanExecution } from "./FakeHumanExecution";
|
||||
import { ClientID, GameID, Intent, Turn } from "../Schemas";
|
||||
import { sanitize, simpleHash } from "../Util";
|
||||
import { fixProfaneUsername } from "../validations/username";
|
||||
import { AllianceRequestExecution } from "./alliance/AllianceRequestExecution";
|
||||
import { AllianceRequestReplyExecution } from "./alliance/AllianceRequestReplyExecution";
|
||||
import { BreakAllianceExecution } from "./alliance/BreakAllianceExecution";
|
||||
import { TargetPlayerExecution } from "./TargetPlayerExecution";
|
||||
import { EmojiExecution } from "./EmojiExecution";
|
||||
import { DonateTroopsExecution } from "./DonateTroopExecution";
|
||||
import { DonateGoldExecution } from "./DonateGoldExecution";
|
||||
import { SetTargetTroopRatioExecution } from "./SetTargetTroopRatioExecution";
|
||||
import { AttackExecution } from "./AttackExecution";
|
||||
import { BotSpawner } from "./BotSpawner";
|
||||
import { ConstructionExecution } from "./ConstructionExecution";
|
||||
import { fixProfaneUsername, isProfaneUsername } from "../validations/username";
|
||||
import { NoOpExecution } from "./NoOpExecution";
|
||||
import { DonateGoldExecution } from "./DonateGoldExecution";
|
||||
import { DonateTroopsExecution } from "./DonateTroopExecution";
|
||||
import { EmbargoExecution } from "./EmbargoExecution";
|
||||
import { RetreatExecution } from "./RetreatExecution";
|
||||
import { EmojiExecution } from "./EmojiExecution";
|
||||
import { FakeHumanExecution } from "./FakeHumanExecution";
|
||||
import { MoveWarshipExecution } from "./MoveWarshipExecution";
|
||||
import { NoOpExecution } from "./NoOpExecution";
|
||||
import { RetreatExecution } from "./RetreatExecution";
|
||||
import { SetTargetTroopRatioExecution } from "./SetTargetTroopRatioExecution";
|
||||
import { SpawnExecution } from "./SpawnExecution";
|
||||
import { TargetPlayerExecution } from "./TargetPlayerExecution";
|
||||
import { TransportShipExecution } from "./TransportShipExecution";
|
||||
|
||||
export class Executor {
|
||||
// private random = new PseudoRandom(999)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
AllianceRequest,
|
||||
Cell,
|
||||
@@ -14,20 +15,18 @@ import {
|
||||
Tick,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { AttackExecution } from "./AttackExecution";
|
||||
import { TransportShipExecution } from "./TransportShipExecution";
|
||||
import { SpawnExecution } from "./SpawnExecution";
|
||||
import { GameID } from "../Schemas";
|
||||
import { consolex } from "../Consolex";
|
||||
import { NukeExecution } from "./NukeExecution";
|
||||
import { EmojiExecution } from "./EmojiExecution";
|
||||
import { AllianceRequestReplyExecution } from "./alliance/AllianceRequestReplyExecution";
|
||||
import { closestTwoTiles } from "./Util";
|
||||
import { calculateBoundingBox, simpleHash } from "../Util";
|
||||
import { andFN, manhattanDistFN, TileRef } from "../game/GameMap";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { GameID } from "../Schemas";
|
||||
import { calculateBoundingBox, simpleHash } from "../Util";
|
||||
import { AllianceRequestReplyExecution } from "./alliance/AllianceRequestReplyExecution";
|
||||
import { AttackExecution } from "./AttackExecution";
|
||||
import { ConstructionExecution } from "./ConstructionExecution";
|
||||
import { renderTroops } from "../../client/Utils";
|
||||
import { EmojiExecution } from "./EmojiExecution";
|
||||
import { NukeExecution } from "./NukeExecution";
|
||||
import { SpawnExecution } from "./SpawnExecution";
|
||||
import { TransportShipExecution } from "./TransportShipExecution";
|
||||
import { closestTwoTiles } from "./Util";
|
||||
|
||||
export class FakeHumanExecution implements Execution {
|
||||
private firstMove = true;
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
import { nextTick } from "process";
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
MessageType,
|
||||
Player,
|
||||
PlayerID,
|
||||
TerraNullius,
|
||||
Unit,
|
||||
UnitType,
|
||||
TerraNullius,
|
||||
MessageType,
|
||||
} from "../game/Game";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { consolex } from "../Consolex";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { simpleHash } from "../Util";
|
||||
import { NukeExecution } from "./NukeExecution";
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
Unit,
|
||||
PlayerID,
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Execution, Game, Player, PlayerID } from "../game/Game";
|
||||
import { Execution, Game } from "../game/Game";
|
||||
|
||||
const cancelDelay = 2;
|
||||
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
PlayerID,
|
||||
Unit,
|
||||
UnitType,
|
||||
TerraNullius,
|
||||
MessageType,
|
||||
NukeType,
|
||||
Player,
|
||||
PlayerID,
|
||||
TerraNullius,
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { consolex } from "../Consolex";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
|
||||
export class NukeExecution implements Execution {
|
||||
private player: Player;
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import { renderNumber } from "../../client/Utils";
|
||||
import { Config } from "../configuration/Config";
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
Execution,
|
||||
Game,
|
||||
MessageType,
|
||||
Player,
|
||||
PlayerID,
|
||||
TerraNullius,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { calculateBoundingBox, getMode, inscribed, simpleHash } from "../Util";
|
||||
import { GameImpl } from "../game/GameImpl";
|
||||
import { consolex } from "../Consolex";
|
||||
import { GameMap, TileRef } from "../game/GameMap";
|
||||
import { renderNumber } from "../../client/Utils";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { calculateBoundingBox, getMode, inscribed, simpleHash } from "../Util";
|
||||
|
||||
export class PlayerExecution implements Execution {
|
||||
private readonly ticksPerClusterCalc = 20;
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
AllPlayers,
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
Unit,
|
||||
PlayerID,
|
||||
TerrainType,
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { TradeShipExecution } from "./TradeShipExecution";
|
||||
import { consolex } from "../Consolex";
|
||||
import { manhattanDistFN, TileRef } from "../game/GameMap";
|
||||
|
||||
export class PortExecution implements Execution {
|
||||
private active = true;
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
Unit,
|
||||
PlayerID,
|
||||
UnitType,
|
||||
MessageType,
|
||||
Player,
|
||||
PlayerID,
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { manhattanDistFN, TileRef } from "../game/GameMap";
|
||||
import { SAMMissileExecution } from "./SAMMissileExecution";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { SAMMissileExecution } from "./SAMMissileExecution";
|
||||
|
||||
export class SAMLauncherExecution implements Execution {
|
||||
private player: Player;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
Execution,
|
||||
Game,
|
||||
@@ -6,10 +7,9 @@ import {
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { consolex } from "../Consolex";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
|
||||
export class SAMMissileExecution implements Execution {
|
||||
private active = true;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Execution, Game, Player, Unit, UnitType } from "../game/Game";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { consolex } from "../Consolex";
|
||||
import { Execution, Game, Player, Unit, UnitType } from "../game/Game";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
|
||||
export class ShellExecution implements Execution {
|
||||
private active = true;
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
import {
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
PlayerInfo,
|
||||
PlayerType,
|
||||
} from "../game/Game";
|
||||
import { Execution, Game, Player, PlayerInfo, PlayerType } from "../game/Game";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { BotExecution } from "./BotExecution";
|
||||
import { PlayerExecution } from "./PlayerExecution";
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
import { MessageType } from "../game/Game";
|
||||
import { renderNumber } from "../../client/Utils";
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
AllPlayers,
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
Unit,
|
||||
MessageType,
|
||||
Player,
|
||||
PlayerID,
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { distSortUnit } from "../Util";
|
||||
import { consolex } from "../Consolex";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { distSortUnit } from "../Util";
|
||||
|
||||
export class TradeShipExecution implements Execution {
|
||||
private active = true;
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
Unit,
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
MessageType,
|
||||
Player,
|
||||
PlayerID,
|
||||
TerraNullius,
|
||||
Unit,
|
||||
UnitType,
|
||||
TerrainType,
|
||||
} from "../game/Game";
|
||||
import { AttackExecution } from "./AttackExecution";
|
||||
import { MessageType } from "../game/Game";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { consolex } from "../Consolex";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { targetTransportTile } from "../Util";
|
||||
import { AttackExecution } from "./AttackExecution";
|
||||
|
||||
export class TransportShipExecution implements Execution {
|
||||
private lastMove: number;
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import {
|
||||
Cell,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
Unit,
|
||||
PlayerID,
|
||||
TerrainType,
|
||||
Unit,
|
||||
UnitType,
|
||||
} from "../game/Game";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { consolex } from "../Consolex";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PathFindResultType } from "../pathfinding/AStar";
|
||||
import { PathFinder } from "../pathfinding/PathFinding";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { ShellExecution } from "./ShellExecution";
|
||||
|
||||
export class WarshipExecution implements Execution {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EventBus, GameEvent } from "../EventBus";
|
||||
import { GameEvent } from "../EventBus";
|
||||
import {
|
||||
Execution,
|
||||
Game,
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import { consolex } from "../../Consolex";
|
||||
import {
|
||||
AllianceRequest,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
PlayerID,
|
||||
} from "../../game/Game";
|
||||
import { Execution, Game, Player, PlayerID } from "../../game/Game";
|
||||
|
||||
export class AllianceRequestExecution implements Execution {
|
||||
private active = true;
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import { consolex } from "../../Consolex";
|
||||
import {
|
||||
AllianceRequest,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
PlayerID,
|
||||
} from "../../game/Game";
|
||||
import { Execution, Game, Player, PlayerID } from "../../game/Game";
|
||||
|
||||
export class AllianceRequestReplyExecution implements Execution {
|
||||
private active = true;
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import { consolex } from "../../Consolex";
|
||||
import {
|
||||
AllianceRequest,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
PlayerID,
|
||||
} from "../../game/Game";
|
||||
import { Execution, Game, Player, PlayerID } from "../../game/Game";
|
||||
|
||||
export class BreakAllianceExecution implements Execution {
|
||||
private active = true;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { MutableAlliance, Game, Player, Tick } from "./Game";
|
||||
import { MutableAlliance, Player, Tick } from "./Game";
|
||||
import { GameImpl } from "./GameImpl";
|
||||
import { PlayerImpl } from "./PlayerImpl";
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { AllianceRequest, Player, Tick } from "./Game";
|
||||
import { AllianceRequestUpdate } from "./GameUpdates";
|
||||
import { GameUpdateType } from "./GameUpdates";
|
||||
import { GameImpl } from "./GameImpl";
|
||||
import { AllianceRequestUpdate, GameUpdateType } from "./GameUpdates";
|
||||
|
||||
export class AllianceRequestImpl implements AllianceRequest {
|
||||
constructor(
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { Config } from "../configuration/Config";
|
||||
import { GameEvent } from "../EventBus";
|
||||
import { PlayerView } from "./GameView";
|
||||
import { ClientID, GameConfig, GameID, AllPlayersStats } from "../Schemas";
|
||||
import { GameMap, GameMapImpl, TileRef } from "./GameMap";
|
||||
import { AllPlayersStats, ClientID } from "../Schemas";
|
||||
import { GameMap, TileRef } from "./GameMap";
|
||||
import {
|
||||
GameUpdate,
|
||||
GameUpdateType,
|
||||
PlayerUpdate,
|
||||
UnitUpdate,
|
||||
} from "./GameUpdates";
|
||||
import { PlayerView } from "./GameView";
|
||||
import { Stats } from "./Stats";
|
||||
|
||||
export type PlayerID = string;
|
||||
|
||||
+25
-26
@@ -1,43 +1,42 @@
|
||||
import { Config } from "../configuration/Config";
|
||||
import { consolex } from "../Consolex";
|
||||
import { AllPlayersStats, ClientID } from "../Schemas";
|
||||
import { simpleHash } from "../Util";
|
||||
import { AllianceImpl } from "./AllianceImpl";
|
||||
import { AllianceRequestImpl } from "./AllianceRequestImpl";
|
||||
import {
|
||||
Alliance,
|
||||
AllianceRequest,
|
||||
Cell,
|
||||
EmojiMessage,
|
||||
Execution,
|
||||
Game,
|
||||
GameMode,
|
||||
GameUpdates,
|
||||
MessageType,
|
||||
Nation,
|
||||
Player,
|
||||
PlayerID,
|
||||
PlayerInfo,
|
||||
Player,
|
||||
PlayerType,
|
||||
Team,
|
||||
TeamName,
|
||||
TerrainType,
|
||||
TerraNullius,
|
||||
Unit,
|
||||
AllianceRequest,
|
||||
Alliance,
|
||||
Nation,
|
||||
UnitType,
|
||||
UnitInfo,
|
||||
GameUpdates,
|
||||
TerrainType,
|
||||
EmojiMessage,
|
||||
Team,
|
||||
GameMode,
|
||||
TeamName,
|
||||
PlayerType,
|
||||
UnitType,
|
||||
} from "./Game";
|
||||
import { GameUpdate } from "./GameUpdates";
|
||||
import { GameUpdateType } from "./GameUpdates";
|
||||
import { NationMap } from "./TerrainMapLoader";
|
||||
import { GameMap, TileRef, TileUpdate } from "./GameMap";
|
||||
import { GameUpdate, GameUpdateType } from "./GameUpdates";
|
||||
import { PlayerImpl } from "./PlayerImpl";
|
||||
import { TerraNulliusImpl } from "./TerraNulliusImpl";
|
||||
import { AllianceRequestImpl } from "./AllianceRequestImpl";
|
||||
import { AllianceImpl } from "./AllianceImpl";
|
||||
import { ClientID, AllPlayersStats } from "../Schemas";
|
||||
import { MessageType } from "./Game";
|
||||
import { UnitImpl } from "./UnitImpl";
|
||||
import { consolex } from "../Consolex";
|
||||
import { GameMap, GameMapImpl, TileRef, TileUpdate } from "./GameMap";
|
||||
import { UnitGrid } from "./UnitGrid";
|
||||
import { StatsImpl } from "./StatsImpl";
|
||||
import { Stats } from "./Stats";
|
||||
import { simpleHash } from "../Util";
|
||||
import { StatsImpl } from "./StatsImpl";
|
||||
import { assignTeams } from "./TeamAssignment";
|
||||
import { NationMap } from "./TerrainMapLoader";
|
||||
import { TerraNulliusImpl } from "./TerraNulliusImpl";
|
||||
import { UnitGrid } from "./UnitGrid";
|
||||
import { UnitImpl } from "./UnitImpl";
|
||||
|
||||
export function createGame(
|
||||
humans: PlayerInfo[],
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { ClientID, PlayerStats, AllPlayersStats } from "../Schemas";
|
||||
import { AllPlayersStats, ClientID, PlayerStats } from "../Schemas";
|
||||
import {
|
||||
AllianceRequest,
|
||||
EmojiMessage,
|
||||
GameUpdates,
|
||||
MapPos,
|
||||
MessageType,
|
||||
NameViewData,
|
||||
PlayerID,
|
||||
|
||||
+18
-21
@@ -1,40 +1,37 @@
|
||||
import {
|
||||
GameUpdates,
|
||||
MapPos,
|
||||
MessageType,
|
||||
nukeTypes,
|
||||
Player,
|
||||
PlayerActions,
|
||||
PlayerProfile,
|
||||
PlayerBorderTiles,
|
||||
TeamName,
|
||||
} from "./Game";
|
||||
import { AttackUpdate, PlayerUpdate } from "./GameUpdates";
|
||||
import { UnitUpdate } from "./GameUpdates";
|
||||
import { NameViewData } from "./Game";
|
||||
import { GameUpdateType } from "./GameUpdates";
|
||||
import { Config } from "../configuration/Config";
|
||||
import { ClientID, GameID, PlayerStats } from "../Schemas";
|
||||
import { WorkerClient } from "../worker/WorkerClient";
|
||||
import {
|
||||
Cell,
|
||||
EmojiMessage,
|
||||
GameUpdates,
|
||||
Gold,
|
||||
NameViewData,
|
||||
nukeTypes,
|
||||
Player,
|
||||
PlayerActions,
|
||||
PlayerBorderTiles,
|
||||
PlayerID,
|
||||
PlayerInfo,
|
||||
PlayerProfile,
|
||||
PlayerType,
|
||||
TeamName,
|
||||
TerrainType,
|
||||
TerraNullius,
|
||||
Tick,
|
||||
UnitInfo,
|
||||
UnitType,
|
||||
} from "./Game";
|
||||
import { ClientID, GameID, PlayerStats } from "../Schemas";
|
||||
import { GameMap, TileRef, TileUpdate } from "./GameMap";
|
||||
import {
|
||||
AttackUpdate,
|
||||
GameUpdateType,
|
||||
GameUpdateViewData,
|
||||
PlayerUpdate,
|
||||
UnitUpdate,
|
||||
} from "./GameUpdates";
|
||||
import { TerraNulliusImpl } from "./TerraNulliusImpl";
|
||||
import { WorkerClient } from "../worker/WorkerClient";
|
||||
import { GameMap, GameMapImpl, TileRef, TileUpdate } from "./GameMap";
|
||||
import { GameUpdateViewData } from "./GameUpdates";
|
||||
import { UnitGrid } from "./UnitGrid";
|
||||
import { consolex } from "../Consolex";
|
||||
import { SAMLauncherExecution } from "../execution/SAMLauncherExecution";
|
||||
|
||||
export class UnitView {
|
||||
public _wasUpdated = true;
|
||||
|
||||
+32
-35
@@ -1,28 +1,6 @@
|
||||
import {
|
||||
Player,
|
||||
PlayerInfo,
|
||||
PlayerID,
|
||||
PlayerType,
|
||||
TerraNullius,
|
||||
Cell,
|
||||
Execution,
|
||||
AllianceRequest,
|
||||
MutableAlliance,
|
||||
Alliance,
|
||||
Tick,
|
||||
AllPlayers,
|
||||
Gold,
|
||||
UnitType,
|
||||
Unit,
|
||||
Relation,
|
||||
EmojiMessage,
|
||||
PlayerProfile,
|
||||
Attack,
|
||||
UnitSpecificInfos,
|
||||
Team,
|
||||
} from "./Game";
|
||||
import { AttackUpdate, PlayerUpdate } from "./GameUpdates";
|
||||
import { GameUpdateType } from "./GameUpdates";
|
||||
import { renderNumber, renderTroops } from "../../client/Utils";
|
||||
import { consolex } from "../Consolex";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { ClientID } from "../Schemas";
|
||||
import {
|
||||
assertNever,
|
||||
@@ -31,21 +9,40 @@ import {
|
||||
maxInt,
|
||||
minInt,
|
||||
simpleHash,
|
||||
sourceDstOceanShore,
|
||||
targetTransportTile,
|
||||
toInt,
|
||||
within,
|
||||
} from "../Util";
|
||||
import { CellString, GameImpl } from "./GameImpl";
|
||||
import { UnitImpl } from "./UnitImpl";
|
||||
import { MessageType } from "./Game";
|
||||
import { renderTroops, renderNumber } from "../../client/Utils";
|
||||
import { TerraNulliusImpl } from "./TerraNulliusImpl";
|
||||
import { andFN, manhattanDistFN, TileRef } from "./GameMap";
|
||||
import { AttackImpl } from "./AttackImpl";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { consolex } from "../Consolex";
|
||||
import { sanitizeUsername } from "../validations/username";
|
||||
import { AttackImpl } from "./AttackImpl";
|
||||
import {
|
||||
Alliance,
|
||||
AllianceRequest,
|
||||
AllPlayers,
|
||||
Attack,
|
||||
Cell,
|
||||
EmojiMessage,
|
||||
Gold,
|
||||
MessageType,
|
||||
MutableAlliance,
|
||||
Player,
|
||||
PlayerID,
|
||||
PlayerInfo,
|
||||
PlayerProfile,
|
||||
PlayerType,
|
||||
Relation,
|
||||
Team,
|
||||
TerraNullius,
|
||||
Tick,
|
||||
Unit,
|
||||
UnitSpecificInfos,
|
||||
UnitType,
|
||||
} from "./Game";
|
||||
import { GameImpl } from "./GameImpl";
|
||||
import { andFN, manhattanDistFN, TileRef } from "./GameMap";
|
||||
import { AttackUpdate, GameUpdateType, PlayerUpdate } from "./GameUpdates";
|
||||
import { TerraNulliusImpl } from "./TerraNulliusImpl";
|
||||
import { UnitImpl } from "./UnitImpl";
|
||||
|
||||
interface Target {
|
||||
tick: Tick;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Player, PlayerInfo, Team, TeamName } from "./Game";
|
||||
import { PlayerInfo, Team, TeamName } from "./Game";
|
||||
|
||||
export function assignTeams(
|
||||
players: PlayerInfo[],
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { ClientID } from "../Schemas";
|
||||
import { TerraNullius, Cell, PlayerID } from "./Game";
|
||||
import { GameImpl } from "./GameImpl";
|
||||
import { TileRef } from "./GameMap";
|
||||
import { PlayerID, TerraNullius } from "./Game";
|
||||
|
||||
export class TerraNulliusImpl implements TerraNullius {
|
||||
constructor() {}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Cell, GameMapType, TerrainType } from "./Game";
|
||||
import { consolex } from "../Consolex";
|
||||
import { GameMapType } from "./Game";
|
||||
import { NationMap } from "./TerrainMapLoader";
|
||||
|
||||
interface MapData {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { consolex } from "../Consolex";
|
||||
import { Cell, GameMapType, TerrainType } from "./Game";
|
||||
import { GameMapType } from "./Game";
|
||||
import { GameMap, GameMapImpl } from "./GameMap";
|
||||
import { terrainMapFileLoader } from "./TerrainMapFileLoader";
|
||||
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
import { MessageType, Tick, UnitSpecificInfos } from "./Game";
|
||||
import { UnitUpdate } from "./GameUpdates";
|
||||
import { GameUpdateType } from "./GameUpdates";
|
||||
import { simpleHash, toInt, within, withinInt } from "../Util";
|
||||
import { Unit, TerraNullius, UnitType, Player, UnitInfo } from "./Game";
|
||||
import { simpleHash, toInt, withinInt } from "../Util";
|
||||
import {
|
||||
MessageType,
|
||||
Player,
|
||||
Tick,
|
||||
Unit,
|
||||
UnitInfo,
|
||||
UnitSpecificInfos,
|
||||
UnitType,
|
||||
} from "./Game";
|
||||
import { GameImpl } from "./GameImpl";
|
||||
import { PlayerImpl } from "./PlayerImpl";
|
||||
import { TileRef } from "./GameMap";
|
||||
import { consolex } from "../Consolex";
|
||||
import { GameUpdateType, UnitUpdate } from "./GameUpdates";
|
||||
import { PlayerImpl } from "./PlayerImpl";
|
||||
|
||||
export class UnitImpl implements Unit {
|
||||
private _active = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Cell } from "../game/Game";
|
||||
import { GameMap, GameMapImpl, TileRef } from "../game/GameMap";
|
||||
import { GameMap, TileRef } from "../game/GameMap";
|
||||
import { AStar, PathFindResultType } from "./AStar";
|
||||
import { SerialAStar } from "./SerialAStar";
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { Cell, Game } from "../game/Game";
|
||||
import { AStar, PathFindResultType, TileResult } from "./AStar";
|
||||
import { SerialAStar } from "./SerialAStar";
|
||||
import { MiniAStar } from "./MiniAStar";
|
||||
import { consolex } from "../Consolex";
|
||||
import { Game } from "../game/Game";
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { AStar, PathFindResultType, TileResult } from "./AStar";
|
||||
import { MiniAStar } from "./MiniAStar";
|
||||
|
||||
export class PathFinder {
|
||||
private curr: TileRef = null;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { PriorityQueue } from "@datastructures-js/priority-queue";
|
||||
import { AStar } from "./AStar";
|
||||
import { PathFindResultType } from "./AStar";
|
||||
import { consolex } from "../Consolex";
|
||||
import { GameMap, GameMapImpl, TileRef } from "../game/GameMap";
|
||||
import { GameMap, TileRef } from "../game/GameMap";
|
||||
import { AStar, PathFindResultType } from "./AStar";
|
||||
|
||||
export class SerialAStar implements AStar {
|
||||
private fwdOpenSet: PriorityQueue<{ tile: TileRef; fScore: number }>;
|
||||
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
englishDataset,
|
||||
englishRecommendedTransformers,
|
||||
} from "obscenity";
|
||||
import { simpleHash } from "../Util";
|
||||
import { translateText } from "../../client/Utils";
|
||||
import { simpleHash } from "../Util";
|
||||
|
||||
const matcher = new RegExpMatcher({
|
||||
...englishDataset.build(),
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { createGameRunner, GameRunner } from "../GameRunner";
|
||||
import { GameUpdateViewData } from "../game/GameUpdates";
|
||||
import {
|
||||
MainThreadMessage,
|
||||
WorkerMessage,
|
||||
InitializedMessage,
|
||||
MainThreadMessage,
|
||||
PlayerActionsResultMessage,
|
||||
PlayerProfileResultMessage,
|
||||
PlayerBorderTilesResultMessage,
|
||||
PlayerProfileResultMessage,
|
||||
WorkerMessage,
|
||||
} from "./WorkerMessages";
|
||||
|
||||
const ctx: Worker = self as any;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
PlayerActions,
|
||||
PlayerBorderTiles,
|
||||
PlayerID,
|
||||
PlayerProfile,
|
||||
PlayerBorderTiles,
|
||||
} from "../game/Game";
|
||||
import { ErrorUpdate, GameUpdateViewData } from "../game/GameUpdates";
|
||||
import { ClientID, GameStartInfo, Turn } from "../Schemas";
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
import { GameUpdateViewData } from "../game/GameUpdates";
|
||||
import {
|
||||
ClientID,
|
||||
Turn,
|
||||
ServerStartGameMessage,
|
||||
GameStartInfo,
|
||||
} from "../Schemas";
|
||||
import {
|
||||
PlayerActions,
|
||||
PlayerBorderTiles,
|
||||
PlayerID,
|
||||
PlayerProfile,
|
||||
PlayerBorderTiles,
|
||||
} from "../game/Game";
|
||||
import { GameUpdateViewData } from "../game/GameUpdates";
|
||||
import { ClientID, GameStartInfo, Turn } from "../Schemas";
|
||||
|
||||
export type WorkerMessageType =
|
||||
| "heartbeat"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user