fix: comments code rabbit

This commit is contained in:
Trajkov Dimitar
2025-12-25 13:12:05 +01:00
parent 9150a1f820
commit dd6f126eb8
3 changed files with 15 additions and 8 deletions
@@ -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;
+8 -5
View File
@@ -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;
+2
View File
@@ -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 }>;