Implement game layer from protobuf to redux

This commit is contained in:
seavor 2026-04-12 05:05:16 -05:00
parent d96d5e1589
commit 74803442d2
82 changed files with 2455 additions and 88 deletions

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { AttachCardParams } from 'types';
export function attachCard(gameId: number, params: AttachCardParams): void {
BackendService.sendGameCommand(gameId, 'Command_AttachCard', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { ChangeZonePropertiesParams } from 'types';
export function changeZoneProperties(gameId: number, params: ChangeZonePropertiesParams): void {
BackendService.sendGameCommand(gameId, 'Command_ChangeZoneProperties', params);
}

View file

@ -0,0 +1,5 @@
import { BackendService } from '../../services/BackendService';
export function concede(gameId: number): void {
BackendService.sendGameCommand(gameId, 'Command_Concede', {});
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { CreateArrowParams } from 'types';
export function createArrow(gameId: number, params: CreateArrowParams): void {
BackendService.sendGameCommand(gameId, 'Command_CreateArrow', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { CreateCounterParams } from 'types';
export function createCounter(gameId: number, params: CreateCounterParams): void {
BackendService.sendGameCommand(gameId, 'Command_CreateCounter', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { CreateTokenParams } from 'types';
export function createToken(gameId: number, params: CreateTokenParams): void {
BackendService.sendGameCommand(gameId, 'Command_CreateToken', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { DeckSelectParams } from 'types';
export function deckSelect(gameId: number, params: DeckSelectParams): void {
BackendService.sendGameCommand(gameId, 'Command_DeckSelect', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { DelCounterParams } from 'types';
export function delCounter(gameId: number, params: DelCounterParams): void {
BackendService.sendGameCommand(gameId, 'Command_DelCounter', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { DeleteArrowParams } from 'types';
export function deleteArrow(gameId: number, params: DeleteArrowParams): void {
BackendService.sendGameCommand(gameId, 'Command_DeleteArrow', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { DrawCardsParams } from 'types';
export function drawCards(gameId: number, params: DrawCardsParams): void {
BackendService.sendGameCommand(gameId, 'Command_DrawCards', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { DumpZoneParams } from 'types';
export function dumpZone(gameId: number, params: DumpZoneParams): void {
BackendService.sendGameCommand(gameId, 'Command_DumpZone', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { FlipCardParams } from 'types';
export function flipCard(gameId: number, params: FlipCardParams): void {
BackendService.sendGameCommand(gameId, 'Command_FlipCard', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { GameSayParams } from 'types';
export function gameSay(gameId: number, params: GameSayParams): void {
BackendService.sendGameCommand(gameId, 'Command_GameSay', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { IncCardCounterParams } from 'types';
export function incCardCounter(gameId: number, params: IncCardCounterParams): void {
BackendService.sendGameCommand(gameId, 'Command_IncCardCounter', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { IncCounterParams } from 'types';
export function incCounter(gameId: number, params: IncCounterParams): void {
BackendService.sendGameCommand(gameId, 'Command_IncCounter', params);
}

View file

@ -0,0 +1,31 @@
export { leaveGame } from './leaveGame';
export { kickFromGame } from './kickFromGame';
export { gameSay } from './gameSay';
export { readyStart } from './readyStart';
export { concede } from './concede';
export { nextTurn } from './nextTurn';
export { setActivePhase } from './setActivePhase';
export { reverseTurn } from './reverseTurn';
export { moveCard } from './moveCard';
export { flipCard } from './flipCard';
export { attachCard } from './attachCard';
export { createToken } from './createToken';
export { setCardAttr } from './setCardAttr';
export { setCardCounter } from './setCardCounter';
export { incCardCounter } from './incCardCounter';
export { drawCards } from './drawCards';
export { undoDraw } from './undoDraw';
export { createArrow } from './createArrow';
export { deleteArrow } from './deleteArrow';
export { createCounter } from './createCounter';
export { setCounter } from './setCounter';
export { incCounter } from './incCounter';
export { delCounter } from './delCounter';
export { shuffle } from './shuffle';
export { dumpZone } from './dumpZone';
export { revealCards } from './revealCards';
export { changeZoneProperties } from './changeZoneProperties';
export { deckSelect } from './deckSelect';
export { setSideboardPlan } from './setSideboardPlan';
export { setSideboardLock } from './setSideboardLock';
export { mulligan } from './mulligan';

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { KickFromGameParams } from 'types';
export function kickFromGame(gameId: number, params: KickFromGameParams): void {
BackendService.sendGameCommand(gameId, 'Command_KickFromGame', params);
}

View file

@ -0,0 +1,5 @@
import { BackendService } from '../../services/BackendService';
export function leaveGame(gameId: number): void {
BackendService.sendGameCommand(gameId, 'Command_LeaveGame', {});
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { MoveCardParams } from 'types';
export function moveCard(gameId: number, params: MoveCardParams): void {
BackendService.sendGameCommand(gameId, 'Command_MoveCard', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { MulliganParams } from 'types';
export function mulligan(gameId: number, params: MulliganParams): void {
BackendService.sendGameCommand(gameId, 'Command_Mulligan', params);
}

View file

@ -0,0 +1,5 @@
import { BackendService } from '../../services/BackendService';
export function nextTurn(gameId: number): void {
BackendService.sendGameCommand(gameId, 'Command_NextTurn', {});
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { ReadyStartParams } from 'types';
export function readyStart(gameId: number, params: ReadyStartParams): void {
BackendService.sendGameCommand(gameId, 'Command_ReadyStart', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { RevealCardsParams } from 'types';
export function revealCards(gameId: number, params: RevealCardsParams): void {
BackendService.sendGameCommand(gameId, 'Command_RevealCards', params);
}

View file

@ -0,0 +1,5 @@
import { BackendService } from '../../services/BackendService';
export function reverseTurn(gameId: number): void {
BackendService.sendGameCommand(gameId, 'Command_ReverseTurn', {});
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { SetActivePhaseParams } from 'types';
export function setActivePhase(gameId: number, params: SetActivePhaseParams): void {
BackendService.sendGameCommand(gameId, 'Command_SetActivePhase', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { SetCardAttrParams } from 'types';
export function setCardAttr(gameId: number, params: SetCardAttrParams): void {
BackendService.sendGameCommand(gameId, 'Command_SetCardAttr', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { SetCardCounterParams } from 'types';
export function setCardCounter(gameId: number, params: SetCardCounterParams): void {
BackendService.sendGameCommand(gameId, 'Command_SetCardCounter', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { SetCounterParams } from 'types';
export function setCounter(gameId: number, params: SetCounterParams): void {
BackendService.sendGameCommand(gameId, 'Command_SetCounter', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { SetSideboardLockParams } from 'types';
export function setSideboardLock(gameId: number, params: SetSideboardLockParams): void {
BackendService.sendGameCommand(gameId, 'Command_SetSideboardLock', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { SetSideboardPlanParams } from 'types';
export function setSideboardPlan(gameId: number, params: SetSideboardPlanParams): void {
BackendService.sendGameCommand(gameId, 'Command_SetSideboardPlan', params);
}

View file

@ -0,0 +1,6 @@
import { BackendService } from '../../services/BackendService';
import { ShuffleParams } from 'types';
export function shuffle(gameId: number, params: ShuffleParams): void {
BackendService.sendGameCommand(gameId, 'Command_Shuffle', params);
}

View file

@ -0,0 +1,5 @@
import { BackendService } from '../../services/BackendService';
export function undoDraw(gameId: number): void {
BackendService.sendGameCommand(gameId, 'Command_UndoDraw', {});
}

View file

@ -1,4 +1,5 @@
export * as AdminCommands from './admin';
export * as GameCommands from './game';
export * as ModeratorCommands from './moderator';
export * as RoomCommands from './room';
export * as SessionCommands from './session';