mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-23 16:16:50 +00:00
fix: comments code rabbit
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { html, LitElement } from "lit";
|
||||
import { customElement, state } from "lit/decorators.js";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
import { GameMode, GameType } from "../../../core/game/Game";
|
||||
import {
|
||||
GameMode,
|
||||
GameType,
|
||||
MIN_GAME_TICKS_FOR_SURRENDER,
|
||||
} from "../../../core/game/Game";
|
||||
import { GameUpdateType } from "../../../core/game/GameUpdates";
|
||||
import { GameView } from "../../../core/game/GameView";
|
||||
import { crazyGamesSDK } from "../../CrazyGamesSDK";
|
||||
@@ -16,8 +20,6 @@ import pauseIcon from "/images/PauseIconWhite.svg?url";
|
||||
import playIcon from "/images/PlayIconWhite.svg?url";
|
||||
import settingsIcon from "/images/SettingIconWhite.svg?url";
|
||||
|
||||
const MIN_GAME_TICKS_FOR_SURRENDER = 3000;
|
||||
|
||||
@customElement("game-right-sidebar")
|
||||
export class GameRightSidebar extends LitElement implements Layer {
|
||||
public game: GameView;
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { Execution, Game, GameMode, Player, PlayerType } from "../game/Game";
|
||||
|
||||
// Minimum game time (after spawn phase) before surrender is allowed: 5 minutes
|
||||
// Game runs at 10 ticks/second, so 5 minutes = 5 * 60 * 10 = 3000 ticks
|
||||
const MIN_GAME_TICKS_FOR_SURRENDER = 3000;
|
||||
import {
|
||||
Execution,
|
||||
Game,
|
||||
GameMode,
|
||||
MIN_GAME_TICKS_FOR_SURRENDER,
|
||||
Player,
|
||||
PlayerType,
|
||||
} from "../game/Game";
|
||||
|
||||
export class SurrenderExecution implements Execution {
|
||||
private mg: Game | null = null;
|
||||
|
||||
@@ -25,6 +25,8 @@ export type Gold = bigint;
|
||||
|
||||
export const AllPlayers = "AllPlayers" as const;
|
||||
|
||||
export const MIN_GAME_TICKS_FOR_SURRENDER = 3000;
|
||||
|
||||
// export type GameUpdates = Record<GameUpdateType, GameUpdate[]>;
|
||||
// Create a type that maps GameUpdateType to its corresponding update type
|
||||
type UpdateTypeMap<T extends GameUpdateType> = Extract<GameUpdate, { type: T }>;
|
||||
|
||||
Reference in New Issue
Block a user