mirror of
https://github.com/AndrioCelos/TableturfBattleApp.git
synced 2026-04-10 02:54:46 -05:00
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
/** A UUID used to identify the client. */
|
|
let clientToken = window.localStorage.getItem('clientToken') || '';
|
|
/** The data of the current game, or null if not in a game. */
|
|
let currentGame: {
|
|
id: string,
|
|
state: GameState,
|
|
/** The list of players in the current game. */
|
|
players: Player[],
|
|
/** The maximum number of players in the game. */
|
|
maxPlayers: number,
|
|
/** The user's player data, or null if they are spectating. */
|
|
me: PlayerData | null,
|
|
turnNumber: number,
|
|
turnTimeLimit: number | null,
|
|
turnTimeLeft: number | null,
|
|
/** The WebSocket used for receiving game events, or null if not yet connected. */
|
|
webSocket: WebSocket | null
|
|
} | null = null;
|
|
|
|
let enterGameTimeout: number | null = null;
|
|
let currentReplay: {
|
|
turns: Move[][],
|
|
placements: PlacementResults[],
|
|
replayPlayerData: ReplayPlayerData[],
|
|
watchingPlayer: number
|
|
} | null = null;
|
|
|
|
const playerList = document.getElementById('playerList')!;
|
|
const playerListItems: HTMLElement[] = [ ];
|
|
|
|
const canPlayCard = [ false, false, false, false ];
|
|
const canPlayCardAsSpecialAttack = [ false, false, false, false ];
|