namespace ActionBlocks.Server.Dtos; public sealed record LobbyPlayerDto(string Id, string Name, bool IsHost); public sealed record ResultDto(string Id, string Name, int Place, int Score, int Lines); public sealed record LobbyDto( string Code, string HostId, string Phase, int MaxPlayers, IReadOnlyList Players, IReadOnlyList? LastResults); public sealed record JoinResultDto(string PlayerId, LobbyDto Lobby); /// [i] is the item in mino i, null if none. public sealed record PieceDto(int Type, string?[] Items); public sealed record ItemCellDto(int X, int Y, string ItemId); /// [i] is the item in [i], null if none. public sealed record ActivePieceDto(int Type, int[][] Cells, string?[] Items); public sealed record PlayerStateDto( string Id, string Name, bool Alive, int? Place, string Board, IReadOnlyList Items, ActivePieceDto? Active, int[][]? Ghost, PieceDto? Hold, bool HoldUsed, IReadOnlyList Next, IReadOnlyList Inventory, int Score, int Lines, int Level, int PendingGarbage, double InvisibleRemaining, double TransformedRemaining); /// A match event. is "itemUsed" or "eliminated". public sealed record MatchEventDto( string Type, string? TargetId = null, string? ItemId = null, string? ItemName = null, string? PlayerId = null, int? Place = null); public sealed record MatchStateDto( string Phase, double Countdown, string? WinnerId, int Width, int Height, IReadOnlyList Players, IReadOnlyList Events); /// Fraction (0..1) of spawned items that are this item; 0 = disabled. /// Effect length for timed items, null for instant ones. public sealed record ItemInfoDto(string Id, string Name, double Share, double? DurationSeconds);