Formatting

This commit is contained in:
2024-05-28 08:55:29 +02:00
parent 2ae7313797
commit 7e8dd31152
2 changed files with 29 additions and 42 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
export enum ContainerVisibility {
NONE = "none",
ONLY_LAST = "only_last",
ALL = "all",
PROTECTED = "protected"
NONE = "none",
ONLY_LAST = "only_last",
ALL = "all",
PROTECTED = "protected",
}
+25 -38
View File
@@ -1,60 +1,47 @@
export interface ClientMessage {
uuid: string
target: string
method: string
args: { [key: string]: string }
uuid: string;
target: string;
method: string;
args: { [key: string]: string };
}
export interface LobbyEvents {
'newGame': (author: IUser, game: IGameListing) => void;
newGame: (author: IUser, game: IGameListing) => void;
}
type TeamEvents = {
team_addPlayer: { gameObject: string, data: IPlayer },
test: { bite: number, data: IPlayer }
}
team_addPlayer: { gameObject: string; data: IPlayer };
};
type TE = {
[T in keyof TeamEvents]: { event: T } & TeamEvents[T]
}
[T in keyof TeamEvents]: { event: T } & TeamEvents[T];
};
type ChildEvents = TE
type ChildEvents = TE;
export interface GameEvents {
"createTeam": (author: IUser, team: ITeam) => void
"removeTeam": (author: IUser, team: ITeam) => void
"createPlayer": (author: IUser, player: IPlayer) => void
"removePlayer": (author: IUser, player: IPlayer, reason: string) => void
"childEvent": (event: ChildEvents[keyof ChildEvents]) => void
createTeam: (author: IUser, team: ITeam) => void;
removeTeam: (author: IUser, team: ITeam) => void;
createPlayer: (author: IUser, player: IPlayer) => void;
removePlayer: (author: IUser, player: IPlayer, reason: string) => void;
childEvent: (event: ChildEvents[keyof ChildEvents]) => void;
}
export interface IGameObject {
readonly uuid: string
readonly uuid: string;
}
export interface IUser {
readonly username: string
readonly image: string
readonly username: string;
readonly image: string;
}
export interface IPlayer extends IGameObject {
export interface IPlayer extends IGameObject {}
}
export interface ITeam extends IGameObject {
}
export interface ITeam extends IGameObject {}
export interface IGameListing extends IGameObject {
readonly players: IUser[]
readonly started: boolean
readonly owner: string
readonly rules: {}
}
readonly players: IUser[];
readonly started: boolean;
readonly owner: string;
readonly rules: {};
}