mirror of
https://github.com/Vale54321/schafkopf-bot.git
synced 2025-12-18 12:39:34 +01:00
Message types and server (#44)
* message type and handling * deleted web-content and fixed bug * edited main page
This commit is contained in:
committed by
GitHub
parent
cab2d36f48
commit
a0a1cfaa4a
@@ -71,6 +71,13 @@ export enum GamePhase {
|
||||
PLAYER_TRICK = "PLAYER_TRICK"
|
||||
}
|
||||
|
||||
export enum MessageType {
|
||||
PLAYER_CARD = "PLAYER_CARD",
|
||||
START_DEDICATED_GAME = "START_DEDICATED_GAME",
|
||||
JOIN_GAME = "JOIN_GAME",
|
||||
REQUEST_SERVER_CONNECTION = "REQUEST_SERVER_CONNECTION",
|
||||
}
|
||||
|
||||
// Define the interface for an array of cards
|
||||
export interface CardArray {
|
||||
cards: Card[];
|
||||
@@ -92,8 +99,13 @@ export interface GameState {
|
||||
|
||||
|
||||
export interface GameStateJson {
|
||||
gamestate: GameState
|
||||
gamestate: GameState,
|
||||
}
|
||||
|
||||
export interface EmptyMessage {
|
||||
message_type: string;
|
||||
content: GameStateJson | CardArray | CardObject;
|
||||
}
|
||||
|
||||
// Define a union type for all possible message types
|
||||
export type BackendMessage = CardObject | CardArray | GameStateJson;
|
||||
export type BackendMessage = EmptyMessage
|
||||
Reference in New Issue
Block a user