46 lines
1.4 KiB
Dart
46 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// 게임 완료 화면에 전달할 데이터 묶음
|
|
class GameResultArgs {
|
|
/// 랭킹 등록 시 사용할 게임 타입 (예: "SUDOKU", "SPIDER")
|
|
final String gameType;
|
|
|
|
/// 랭킹 등록 시 사용할 난이도 ID (예: "SUDOKU_9x9_L5")
|
|
final String contextId;
|
|
|
|
/// 랭킹 등록용 주 점수 (스도쿠: 시간, 스파이더: 이동 횟수)
|
|
final int primaryScore;
|
|
|
|
/// 랭킹 등록용 보조 점수 (스도쿠: (5-점수), 스파이더: 시간)
|
|
final int? secondaryScore;
|
|
|
|
/// 랭킹 등록에 필요한 유저 ID
|
|
final String userId;
|
|
|
|
/// 이름 입력 필드에 미리 채워줄 유저 이름
|
|
final String? userName;
|
|
|
|
/// 랭킹 목록에 점수를 표시할 포맷터 함수
|
|
/// 예: (120, 2) => "02:00 (Score: 3)"
|
|
final String Function(int primary, int? secondary) scoreFormatter;
|
|
|
|
/// 랭킹 등록 성공 시 호출될 게임별 후속 처리 콜백
|
|
/// (예: 다음 레벨 잠금 해제)
|
|
final Future<void> Function(String playerName) onProgressSave;
|
|
|
|
// ❌ [삭제] onScreenClose 콜백 제거
|
|
// final VoidCallback onScreenClose;
|
|
|
|
GameResultArgs({
|
|
required this.gameType,
|
|
required this.contextId,
|
|
required this.primaryScore,
|
|
this.secondaryScore,
|
|
required this.userId,
|
|
this.userName,
|
|
required this.scoreFormatter,
|
|
required this.onProgressSave,
|
|
// ❌ [삭제]
|
|
// required this.onScreenClose,
|
|
});
|
|
} |