// lib/models/sudoku_game_dto.dart

class SudokuGameDto {
  final int puzzleId; // 👈 [추가] 서버에서 보낸 ID
  final String question;
  final String solution;
  final int blockSize;
  final int gridSize;

  SudokuGameDto({
    required this.puzzleId, // 👈 [추가]
    required this.question,
    required this.solution,
    required this.blockSize,
  }) : gridSize = blockSize * blockSize;

  factory SudokuGameDto.fromJson(Map<String, dynamic> json) {
    int bs = json['blockSize'] ?? 3;
    return SudokuGameDto(
      puzzleId: json['puzzleId'], // 👈 [추가] 서버의 puzzleId 매핑
      question: json['question'],
      solution: json['solution'],
      blockSize: bs,
    );
  }
}