mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
cleanup testing utilities, documentation, and AI commentary
This commit is contained in:
parent
bd2382c94e
commit
ef6cea6f6c
150 changed files with 891 additions and 1233 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import type { IAdminResponse } from '@app/websocket';
|
||||
import { WebsocketTypes } from '@app/websocket/types';
|
||||
import { ServerDispatch } from '@app/store';
|
||||
|
||||
export class AdminResponseImpl implements IAdminResponse {
|
||||
export class AdminResponseImpl implements WebsocketTypes.IAdminResponse {
|
||||
adjustMod(userName: string, shouldBeMod: boolean, shouldBeJudge: boolean): void {
|
||||
ServerDispatch.adjustMod(userName, shouldBeMod, shouldBeJudge);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Data } from '@app/types';
|
||||
import type { IGameResponse } from '@app/websocket';
|
||||
import { WebsocketTypes } from '@app/websocket/types';
|
||||
import { GameDispatch } from '@app/store';
|
||||
|
||||
export class GameResponseImpl implements IGameResponse {
|
||||
export class GameResponseImpl implements WebsocketTypes.IGameResponse {
|
||||
clearStore(): void {
|
||||
GameDispatch.clearStore();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Data } from '@app/types';
|
||||
import type { IModeratorResponse } from '@app/websocket';
|
||||
import { WebsocketTypes } from '@app/websocket/types';
|
||||
import { ServerDispatch } from '@app/store';
|
||||
|
||||
export class ModeratorResponseImpl implements IModeratorResponse {
|
||||
export class ModeratorResponseImpl implements WebsocketTypes.IModeratorResponse {
|
||||
banFromServer(userName: string): void {
|
||||
ServerDispatch.banFromServer(userName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { Data } from '@app/types';
|
||||
import type { IRoomResponse, WebSocketRoomResponseOverrides } from '@app/websocket';
|
||||
import { WebsocketTypes } from '@app/websocket/types';
|
||||
import { RoomsDispatch } from '@app/store';
|
||||
|
||||
type Message = WebSocketRoomResponseOverrides['Event_RoomSay'];
|
||||
type Message = WebsocketTypes.WebSocketRoomResponseOverrides['Event_RoomSay'];
|
||||
|
||||
export class RoomResponseImpl implements IRoomResponse<WebSocketRoomResponseOverrides> {
|
||||
export class RoomResponseImpl implements WebsocketTypes.IRoomResponse<WebsocketTypes.WebSocketRoomResponseOverrides> {
|
||||
clearStore(): void {
|
||||
RoomsDispatch.clearStore();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
import { Data } from '@app/types';
|
||||
import type { ISessionResponse, WebSocketSessionResponseOverrides } from '@app/websocket';
|
||||
import { StatusEnum } from '@app/websocket';
|
||||
import { WebsocketTypes } from '@app/websocket/types';
|
||||
import { GameDispatch, RoomsDispatch, ServerDispatch } from '@app/store';
|
||||
|
||||
type LoginSuccess = WebSocketSessionResponseOverrides['Response_Login'];
|
||||
type PendingActivation = WebSocketSessionResponseOverrides['Response'];
|
||||
type LoginSuccess = WebsocketTypes.WebSocketSessionResponseOverrides['Response_Login'];
|
||||
type PendingActivation = WebsocketTypes.WebSocketSessionResponseOverrides['Response'];
|
||||
|
||||
export class SessionResponseImpl implements ISessionResponse<WebSocketSessionResponseOverrides> {
|
||||
export class SessionResponseImpl implements WebsocketTypes.ISessionResponse<WebsocketTypes.WebSocketSessionResponseOverrides> {
|
||||
initialized(): void {
|
||||
ServerDispatch.initialized();
|
||||
}
|
||||
|
|
@ -67,8 +66,8 @@ export class SessionResponseImpl implements ISessionResponse<WebSocketSessionRes
|
|||
ServerDispatch.updateInfo(name, version);
|
||||
}
|
||||
|
||||
updateStatus(state: StatusEnum, description: string): void {
|
||||
if (state === StatusEnum.DISCONNECTED) {
|
||||
updateStatus(state: WebsocketTypes.StatusEnum, description: string): void {
|
||||
if (state === WebsocketTypes.StatusEnum.DISCONNECTED) {
|
||||
GameDispatch.clearStore();
|
||||
RoomsDispatch.clearStore();
|
||||
ServerDispatch.clearStore();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { IWebClientResponse } from '@app/websocket';
|
||||
import { WebsocketTypes } from '@app/websocket/types';
|
||||
|
||||
import { SessionResponseImpl } from './SessionResponseImpl';
|
||||
import { RoomResponseImpl } from './RoomResponseImpl';
|
||||
|
|
@ -8,7 +8,7 @@ import { ModeratorResponseImpl } from './ModeratorResponseImpl';
|
|||
|
||||
export { SessionResponseImpl, RoomResponseImpl, GameResponseImpl, AdminResponseImpl, ModeratorResponseImpl };
|
||||
|
||||
export function createWebClientResponse(): IWebClientResponse {
|
||||
export function createWebClientResponse(): WebsocketTypes.IWebClientResponse {
|
||||
return {
|
||||
session: new SessionResponseImpl(),
|
||||
room: new RoomResponseImpl(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue