fixed string | null

This commit is contained in:
Aotumuri
2025-05-20 20:51:57 +09:00
parent 2e617d4958
commit f856d7f189
6 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -374,7 +374,7 @@ export const PlayerSchema = z.object({
clientID: ID,
username: SafeString,
flag: SafeString.optional(),
pattern: SafeString.nullable().optional(),
pattern: SafeString.nullable(),
});
export const GameStartInfoSchema = z.object({
@@ -446,7 +446,7 @@ export const ClientJoinMessageSchema = z.object({
lastTurn: z.number(), // The last turn the client saw.
username: SafeString,
flag: SafeString.nullable(),
pattern: SafeString.nullable().optional(),
pattern: SafeString.nullable(),
});
export const ClientMessageSchema = z.union([
+1 -1
View File
@@ -304,7 +304,7 @@ export class PlayerInfo {
public readonly clan: string | null;
constructor(
public readonly pattern: string | null | undefined,
public readonly pattern: string | null,
public readonly flag: string | undefined,
public readonly name: string,
public readonly playerType: PlayerType,
+1 -1
View File
@@ -93,7 +93,7 @@ export interface PlayerUpdate {
type: GameUpdateType.Player;
nameViewData?: NameViewData;
clientID: ClientID | null;
pattern: string | undefined | null;
pattern: string | null;
flag: string | undefined;
name: string;
displayName: string;
+1 -1
View File
@@ -172,7 +172,7 @@ export class PlayerView {
return this.data.flag;
}
pattern(): string | undefined | null {
pattern(): string | null {
return this.data.pattern;
}
+2 -2
View File
@@ -80,7 +80,7 @@ export class PlayerImpl implements Player {
public _units: Unit[] = [];
public _tiles: Set<TileRef> = new Set();
private _pattern: string | undefined | null;
private _pattern: string | null;
private _flag: string | undefined;
private _name: string;
private _displayName: string;
@@ -180,7 +180,7 @@ export class PlayerImpl implements Player {
return this._smallID;
}
pattern(): string | undefined | null {
pattern(): string | null {
return this._pattern;
}
+1 -1
View File
@@ -19,6 +19,6 @@ export class Client {
public readonly username: string,
public readonly ws: WebSocket,
public readonly flag: string | null,
public readonly pattern: string | undefined | null,
public readonly pattern: string | null,
) {}
}