This commit is contained in:
2025-11-14 18:03:50 +09:00
parent 1f5cea9a96
commit 13ed537b23
342 changed files with 18293 additions and 0 deletions
@@ -0,0 +1,21 @@
// packages/feature_common/lib/models/game_info.dart
import 'package:flutter/material.dart';
/// HomeScreen이 표시할 게임 목록의 정보 모델.
/// 최종 'app' 패키지가 이 정보를 채워서 HomeScreen에 주입합니다.
class GameInfo {
final String id;
final String name;
final IconData icon;
/// [핵심] 이 게임을 눌렀을 때 실행될 실제 동작 (예: 화면 이동).
final VoidCallback onTap;
GameInfo({
required this.id,
required this.name,
required this.icon,
required this.onTap,
});
}
@@ -0,0 +1,45 @@
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;
/// 팝업이 닫힐 때 게임 화면을 닫기 위한 콜백
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,
});
}