@haelp/teto
Version:
A typescript-based controllable TETR.IO client.
1 lines • 3.66 kB
Source Map (JSON)
{"version":3,"sources":["../../src/engine/types.ts"],"sourcesContent":["import type {\n Board,\n ConnectedBoard,\n Engine,\n GarbageQueueSnapshot,\n Mino,\n OutgoingGarbage,\n TetrominoSnapshot\n} from \".\";\nimport type { Game } from \"../types\";\nimport { type IGEHandlerSnapshot } from \"./multiplayer\";\n\nexport type SpinType = \"none\" | \"mini\" | \"normal\";\n\nexport interface IncreasableValue {\n value: number;\n increase: number;\n marginTime: number;\n}\n\nexport interface EngineSnapshot {\n frame: number;\n subframe: number;\n queue: number;\n hold: Mino | null;\n holdLocked: boolean;\n input: Engine[\"input\"];\n falling: TetrominoSnapshot;\n lastSpin: Engine[\"lastSpin\"];\n lastWasClear: boolean;\n garbage: GarbageQueueSnapshot;\n board: Board[\"state\"];\n connectedBoard: ConnectedBoard[\"state\"];\n targets?: number[];\n stats: Engine[\"stats\"];\n glock: number;\n state: number;\n currentSpike: number;\n ige: IGEHandlerSnapshot;\n resCache: Engine[\"resCache\"];\n}\n\nexport interface LockRes {\n /** The locked mino */\n mino: Mino;\n /** The number of garbage lines cleared */\n garbageCleared: number;\n /** The number of lines cleared */\n lines: number;\n /** The type of spin performed */\n spin: SpinType;\n /** Garbage from attacks before cancelling */\n rawGarbage: number[];\n /** Garbage from attacks after cancelling */\n garbage: number[];\n /** The amount of garbage released by surge before cancelling */\n surge: number;\n /** The current engine stats */\n stats: {\n garbage: {\n sent: number;\n attack: number;\n receive: number;\n cleared: number;\n };\n combo: number;\n b2b: number;\n pieces: number;\n lines: number;\n };\n /** The amount of garbage added to the board */\n garbageAdded: false | OutgoingGarbage[];\n /** Whether or not the engine is topped out */\n topout: boolean;\n /** The number of frames since the last piece was placed */\n pieceTime: number;\n /** The keys pressed since the last lock */\n keysPresses: Game.Key[];\n}\n\nexport interface Events {\n /** Fired when garbage is recieved, immediately after it is added to the garbage queue */\n \"garbage.receive\": {\n /** The garbage's interaction id */\n iid: number;\n /** The amount added to the garbage queue after passthrough canceling */\n amount: number;\n /** The original amount recieved before passthrough cancelling */\n originalAmount: number;\n };\n /** Fired when garbage is confirmed (interaction_confirm ige). This starts the cancel timer (usually 20 frames) */\n \"garbage.confirm\": {\n /** The garbage's interaction id */\n iid: number;\n /** The sender's game id */\n gameid: number;\n /** The frame to start timer at */\n frame: number;\n };\n /** Fired immediately after garbage is tanked. */\n \"garbage.tank\": {\n /** The garbage's interaction id */\n iid: number;\n /** The garbage's spawn column (0-indexed) */\n column: number;\n /** The height of the garbage column */\n amount: number;\n /** The width of the garbage column */\n size: number;\n };\n /** Fired immediately after garbage is cancelled. */\n \"garbage.cancel\": {\n /** The garbage's interaction id */\n iid: number;\n /** The amount of garbage that was cancelled */\n amount: number;\n /** The width of the would-be garbage */\n size: number;\n };\n\n /** Fired whenever a piece locks. */\n \"falling.lock\": LockRes;\n\n /** Fired whenever a new set of pieces is added to the queue. */\n \"queue.add\": Mino[];\n}\n"],"names":[],"mappings":"AAgFA,WA6CC"}