mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
Implement game layer from protobuf to redux
This commit is contained in:
parent
d96d5e1589
commit
74803442d2
82 changed files with 2455 additions and 88 deletions
6
webclient/src/websocket/commands/game/attachCard.ts
Normal file
6
webclient/src/websocket/commands/game/attachCard.ts
Normal 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);
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
5
webclient/src/websocket/commands/game/concede.ts
Normal file
5
webclient/src/websocket/commands/game/concede.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { BackendService } from '../../services/BackendService';
|
||||
|
||||
export function concede(gameId: number): void {
|
||||
BackendService.sendGameCommand(gameId, 'Command_Concede', {});
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/createArrow.ts
Normal file
6
webclient/src/websocket/commands/game/createArrow.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/createCounter.ts
Normal file
6
webclient/src/websocket/commands/game/createCounter.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/createToken.ts
Normal file
6
webclient/src/websocket/commands/game/createToken.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/deckSelect.ts
Normal file
6
webclient/src/websocket/commands/game/deckSelect.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/delCounter.ts
Normal file
6
webclient/src/websocket/commands/game/delCounter.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/deleteArrow.ts
Normal file
6
webclient/src/websocket/commands/game/deleteArrow.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/drawCards.ts
Normal file
6
webclient/src/websocket/commands/game/drawCards.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/dumpZone.ts
Normal file
6
webclient/src/websocket/commands/game/dumpZone.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/flipCard.ts
Normal file
6
webclient/src/websocket/commands/game/flipCard.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/gameSay.ts
Normal file
6
webclient/src/websocket/commands/game/gameSay.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/incCardCounter.ts
Normal file
6
webclient/src/websocket/commands/game/incCardCounter.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/incCounter.ts
Normal file
6
webclient/src/websocket/commands/game/incCounter.ts
Normal 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);
|
||||
}
|
||||
31
webclient/src/websocket/commands/game/index.ts
Normal file
31
webclient/src/websocket/commands/game/index.ts
Normal 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';
|
||||
6
webclient/src/websocket/commands/game/kickFromGame.ts
Normal file
6
webclient/src/websocket/commands/game/kickFromGame.ts
Normal 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);
|
||||
}
|
||||
5
webclient/src/websocket/commands/game/leaveGame.ts
Normal file
5
webclient/src/websocket/commands/game/leaveGame.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { BackendService } from '../../services/BackendService';
|
||||
|
||||
export function leaveGame(gameId: number): void {
|
||||
BackendService.sendGameCommand(gameId, 'Command_LeaveGame', {});
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/moveCard.ts
Normal file
6
webclient/src/websocket/commands/game/moveCard.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/mulligan.ts
Normal file
6
webclient/src/websocket/commands/game/mulligan.ts
Normal 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);
|
||||
}
|
||||
5
webclient/src/websocket/commands/game/nextTurn.ts
Normal file
5
webclient/src/websocket/commands/game/nextTurn.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { BackendService } from '../../services/BackendService';
|
||||
|
||||
export function nextTurn(gameId: number): void {
|
||||
BackendService.sendGameCommand(gameId, 'Command_NextTurn', {});
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/readyStart.ts
Normal file
6
webclient/src/websocket/commands/game/readyStart.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/revealCards.ts
Normal file
6
webclient/src/websocket/commands/game/revealCards.ts
Normal 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);
|
||||
}
|
||||
5
webclient/src/websocket/commands/game/reverseTurn.ts
Normal file
5
webclient/src/websocket/commands/game/reverseTurn.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { BackendService } from '../../services/BackendService';
|
||||
|
||||
export function reverseTurn(gameId: number): void {
|
||||
BackendService.sendGameCommand(gameId, 'Command_ReverseTurn', {});
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/setActivePhase.ts
Normal file
6
webclient/src/websocket/commands/game/setActivePhase.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/setCardAttr.ts
Normal file
6
webclient/src/websocket/commands/game/setCardAttr.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/setCardCounter.ts
Normal file
6
webclient/src/websocket/commands/game/setCardCounter.ts
Normal 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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/setCounter.ts
Normal file
6
webclient/src/websocket/commands/game/setCounter.ts
Normal 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);
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
6
webclient/src/websocket/commands/game/shuffle.ts
Normal file
6
webclient/src/websocket/commands/game/shuffle.ts
Normal 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);
|
||||
}
|
||||
5
webclient/src/websocket/commands/game/undoDraw.ts
Normal file
5
webclient/src/websocket/commands/game/undoDraw.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { BackendService } from '../../services/BackendService';
|
||||
|
||||
export function undoDraw(gameId: number): void {
|
||||
BackendService.sendGameCommand(gameId, 'Command_UndoDraw', {});
|
||||
}
|
||||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue