....
This commit is contained in:
@@ -1,37 +1,43 @@
|
||||
// packages/feature_game_finddiff/lib/models/finddiff_models.dart
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:service_api/service_api.dart';
|
||||
|
||||
/// 문제 유형 (무엇이 다른가?)
|
||||
/// 문제 유형
|
||||
enum FindDiffType {
|
||||
color, // 색상이 다름 (빨강 vs 핑크)
|
||||
icon, // 모양이 다름 (😀 vs 😃)
|
||||
rotate, // 각도가 다름 (↑ vs ↗)
|
||||
color, // 색상이 다름
|
||||
icon, // 모양이 다름
|
||||
rotate, // 각도가 다름
|
||||
category, // 범주가 다름
|
||||
word, // 글자가 다름
|
||||
mix, // 무작위
|
||||
}
|
||||
|
||||
/// 개별 아이템 데이터
|
||||
class FindDiffItem {
|
||||
final int id;
|
||||
final IconData icon;
|
||||
final IconData? icon;
|
||||
final String? textContent;
|
||||
final Color color;
|
||||
final double angle; // 라디안 (0.0 ~ 2*pi)
|
||||
final bool isTarget; // 정답 여부 (다른 그림)
|
||||
final double angle;
|
||||
final bool isTarget;
|
||||
|
||||
FindDiffItem({
|
||||
required this.id,
|
||||
required this.icon,
|
||||
this.icon,
|
||||
this.textContent,
|
||||
required this.color,
|
||||
this.angle = 0.0,
|
||||
this.isTarget = false,
|
||||
});
|
||||
}
|
||||
|
||||
/// 난이도 정의
|
||||
class FindDiffDifficulty extends GameDifficulty {
|
||||
final int levelIndex;
|
||||
final int rows; // 격자 행
|
||||
final int cols; // 격자 열
|
||||
final int timeLimitSeconds; // 제한 시간
|
||||
final FindDiffType diffType; // 문제 유형
|
||||
final int rows;
|
||||
final int cols;
|
||||
final int timeLimitSeconds;
|
||||
final FindDiffType diffType;
|
||||
|
||||
const FindDiffDifficulty({
|
||||
required this.levelIndex,
|
||||
@@ -47,54 +53,89 @@ class FindDiffDifficulty extends GameDifficulty {
|
||||
}
|
||||
|
||||
class FindDiffDifficulties {
|
||||
// --- 아이콘 풀 (모양 찾기용) ---
|
||||
// 서로 비슷하게 생긴 아이콘 쌍 (정답 vs 오답)
|
||||
// --- [🔥 확장] 모양 찾기용 아이콘 쌍 (20쌍) ---
|
||||
static const List<List<IconData>> iconPairs = [
|
||||
[Icons.sentiment_satisfied_alt, Icons.sentiment_satisfied], // 웃음 vs 미소
|
||||
[Icons.star, Icons.star_border], // 별 vs 빈별
|
||||
[Icons.check_circle, Icons.check_circle_outline], // 체크 vs 빈체크
|
||||
[Icons.favorite, Icons.favorite_border], // 하트 vs 빈하트
|
||||
[Icons.lock, Icons.lock_open], // 잠금 vs 열림
|
||||
[Icons.volume_up, Icons.volume_down], // 소리 큼 vs 작음
|
||||
[Icons.battery_full, Icons.battery_alert], // 배터리 가득 vs 경고
|
||||
[Icons.signal_wifi_4_bar, Icons.signal_wifi_off], // 와이파이 vs 꺼짐
|
||||
[Icons.brightness_5, Icons.brightness_4], // 해 vs 달
|
||||
[Icons.directions_walk, Icons.directions_run], // 걷기 vs 뛰기
|
||||
[Icons.mic, Icons.mic_off], // 마이크 vs 꺼짐
|
||||
[Icons.videocam, Icons.videocam_off], // 캠 vs 꺼짐
|
||||
[Icons.notifications, Icons.notifications_off], // 알림 vs 꺼짐
|
||||
[Icons.wifi, Icons.wifi_off], // 와이파이 vs 꺼짐
|
||||
// 추가된 쌍
|
||||
[Icons.volume_up, Icons.volume_off], // 소리 vs 무음
|
||||
[Icons.visibility, Icons.visibility_off], // 보임 vs 안보임
|
||||
[Icons.thumb_up, Icons.thumb_down], // 따봉 vs 역따봉
|
||||
[Icons.battery_full, Icons.battery_alert], // 배터리 vs 경고
|
||||
[Icons.signal_cellular_4_bar, Icons.signal_cellular_off], // 신호 vs 꺼짐
|
||||
[Icons.folder, Icons.folder_open], // 폴더 vs 열림
|
||||
[Icons.email, Icons.drafts], // 메일 vs 편지
|
||||
[Icons.cloud, Icons.cloud_queue], // 구름 vs 윤곽선
|
||||
[Icons.location_on, Icons.location_off], // 위치 vs 꺼짐
|
||||
[Icons.bookmark, Icons.bookmark_border], // 북마크 vs 빈북마크
|
||||
];
|
||||
|
||||
// --- [🔥 신규] 회전 찾기용 아이콘 (방향성이 명확한 것들만) ---
|
||||
static const List<IconData> rotateIcons = [
|
||||
Icons.flight, Icons.navigation, Icons.send, Icons.north, Icons.cut,
|
||||
Icons.vpn_key, Icons.gavel, Icons.umbrella, Icons.music_note, Icons.flash_on,
|
||||
Icons.thumb_up, Icons.pan_tool, Icons.pets, Icons.star, Icons.favorite,
|
||||
Icons.play_arrow, Icons.call, Icons.build, Icons.brush, Icons.edit,
|
||||
Icons.search, Icons.flag, Icons.push_pin, Icons.local_dining, Icons.local_taxi
|
||||
];
|
||||
|
||||
// --- 단일 아이콘 풀 (색상/회전 찾기용) ---
|
||||
static const List<IconData> basicIcons = [
|
||||
// --- 색상 찾기용 아이콘 (단순한 모양) ---
|
||||
static const List<IconData> colorIcons = [
|
||||
Icons.circle, Icons.square, Icons.star, Icons.favorite, Icons.change_history,
|
||||
Icons.hexagon, Icons.pentagon, Icons.emoji_emotions, Icons.pets, Icons.flight,
|
||||
Icons.cloud, Icons.local_fire_department, Icons.water_drop, Icons.grass, Icons.sunny
|
||||
];
|
||||
|
||||
// --- [🔥 확장] 카테고리별 이모지 풀 (6개 카테고리) ---
|
||||
static const Map<String, List<String>> emojiCategories = {
|
||||
'animal': ["🐶", "🐱", "🐭", "🐹", "🐰", "🦊", "🐻", "🐼", "🐯", "🦁", "🐮", "🐷", "🐸", "🐔", "🐧", "🐦", "🐤", "🦆", "🦅", "🦉"],
|
||||
'food': ["🍎", "🍌", "🍇", "🍓", "🍊", "🍋", "🍉", "🍔", "🍕", "🌭", "🍿", "🍩", "🍪", "🍰", "🍫", "🍬", "🍭", "🍮", "🍯", "🥐"],
|
||||
'vehicle': ["🚗", "🚕", "🚙", "🚌", "🚎", "🏎️", "🚓", "🚑", "🚒", "✈️", "🚀", "🚁", "🚂", "🚆", "🚲", "🛵", "🏍️", "⛵", "🚤", "🛳️"],
|
||||
'face': ["😀", "😃", "😄", "😁", "😆", "😅", "🤣", "😂", "🙂", "🙃", "😉", "😊", "😇", "🥰", "😍", "🤩", "😘", "😗", "😚", "😙"],
|
||||
'plant': ["🌵", "🎄", "🌲", "🌳", "🌴", "🌱", "🌿", "☘️", "🍀", "🎍", "🎋", "🍃", "🍂", "🍁", "🍄", "🌾", "💐", "🌷", "🌹", "🥀"],
|
||||
'sports': ["⚽", "🏀", "🏈", "⚾", "🥎", "🎾", "🏐", "🏉", "🎱", "🏓", "🏸", "🥅", "🥊", "🥋", "🥇", "🥈", "🥉", "🏅", "🎖", "🏆"],
|
||||
};
|
||||
|
||||
// --- 유사 단어 풀 (오타 찾기용) - 기존 100개 단어 사용 (이전 코드 유지)
|
||||
// (HangulUtils를 사용하므로 baseWords 리스트만 있으면 됩니다. 여기서는 생략하지 않고 포함합니다)
|
||||
static const List<String> baseWords = [
|
||||
"강아지", "고양이", "코끼리", "원숭이", "호랑이", "사자", "기린", "토끼", "다람쥐", "거북이",
|
||||
"독수리", "갈매기", "비둘기", "참새", "까치", "펭귄", "돌고래", "고래", "상어", "문어",
|
||||
"선풍기", "냉장고", "세탁기", "청소기", "텔레비전", "컴퓨터", "노트북", "스마트폰", "카메라", "시계",
|
||||
"자동차", "자전거", "비행기", "지하철", "버스", "기차", "택시", "오토바이", "트럭", "배",
|
||||
"사과", "바나나", "포도", "수박", "딸기", "오렌지", "키위", "복숭아", "자두", "레몬",
|
||||
"짜장면", "짬뽕", "탕수육", "김치찌개", "된장찌개", "비빔밥", "불고기", "떡볶이", "김밥", "라면",
|
||||
"하늘", "구름", "바람", "태양", "달", "별", "우주", "바다", "강", "산",
|
||||
"학교", "병원", "은행", "우체국", "경찰서", "소방서", "도서관", "박물관", "공원", "시장",
|
||||
"사랑", "행복", "우정", "가족", "친구", "선생님", "학생", "의사", "군인", "요리사",
|
||||
"대한민국", "무궁화", "태극기", "애국가", "한글", "세종대왕", "이순신", "독도", "서울", "부산",
|
||||
];
|
||||
|
||||
// [15단계 난이도 구성]
|
||||
static final List<FindDiffDifficulty> allDifficulties = [
|
||||
// --- Phase 1: 색상 구분 (초급) ---
|
||||
// 색상 차이가 뚜렷함 -> 미세함
|
||||
const FindDiffDifficulty(levelIndex: 1, name: 'Lv. 1: 색상 (2x2)', contextId: 'DIFF_L1_COLOR_2x2', rows: 2, cols: 2, timeLimitSeconds: 10, diffType: FindDiffType.color),
|
||||
const FindDiffDifficulty(levelIndex: 2, name: 'Lv. 2: 색상 (3x3)', contextId: 'DIFF_L2_COLOR_3x3', rows: 3, cols: 3, timeLimitSeconds: 10, diffType: FindDiffType.color),
|
||||
const FindDiffDifficulty(levelIndex: 3, name: 'Lv. 3: 색상 (4x4)', contextId: 'DIFF_L3_COLOR_4x4', rows: 4, cols: 4, timeLimitSeconds: 8, diffType: FindDiffType.color),
|
||||
const FindDiffDifficulty(levelIndex: 4, name: 'Lv. 4: 미세 색상 (4x4)', contextId: 'DIFF_L4_COLOR_HARD', rows: 4, cols: 4, timeLimitSeconds: 6, diffType: FindDiffType.color),
|
||||
|
||||
// --- Phase 2: 모양 구분 (중급) ---
|
||||
// 비슷한 아이콘 찾기
|
||||
const FindDiffDifficulty(levelIndex: 5, name: 'Lv. 5: 모양 (3x3)', contextId: 'DIFF_L5_ICON_3x3', rows: 3, cols: 3, timeLimitSeconds: 10, diffType: FindDiffType.icon),
|
||||
const FindDiffDifficulty(levelIndex: 6, name: 'Lv. 6: 모양 (4x4)', contextId: 'DIFF_L6_ICON_4x4', rows: 4, cols: 4, timeLimitSeconds: 8, diffType: FindDiffType.icon),
|
||||
const FindDiffDifficulty(levelIndex: 7, name: 'Lv. 7: 모양 (5x5)', contextId: 'DIFF_L7_ICON_5x5', rows: 5, cols: 5, timeLimitSeconds: 8, diffType: FindDiffType.icon),
|
||||
const FindDiffDifficulty(levelIndex: 8, name: 'Lv. 8: 모양 (6x6)', contextId: 'DIFF_L8_ICON_6x6', rows: 6, cols: 6, timeLimitSeconds: 8, diffType: FindDiffType.icon),
|
||||
|
||||
// --- Phase 3: 회전 구분 (상급) ---
|
||||
// 같은 아이콘인데 각도가 다름
|
||||
const FindDiffDifficulty(levelIndex: 9, name: 'Lv. 9: 회전 (4x4)', contextId: 'DIFF_L9_ROT_4x4', rows: 4, cols: 4, timeLimitSeconds: 8, diffType: FindDiffType.rotate),
|
||||
const FindDiffDifficulty(levelIndex: 10, name: 'Lv. 10: 회전 (5x5)', contextId: 'DIFF_L10_ROT_5x5', rows: 5, cols: 5, timeLimitSeconds: 7, diffType: FindDiffType.rotate),
|
||||
const FindDiffDifficulty(levelIndex: 11, name: 'Lv. 11: 회전 (6x6)', contextId: 'DIFF_L11_ROT_6x6', rows: 6, cols: 6, timeLimitSeconds: 6, diffType: FindDiffType.rotate),
|
||||
|
||||
// --- Phase 4: 마스터 (대형 그리드 + 짧은 시간) ---
|
||||
const FindDiffDifficulty(levelIndex: 12, name: 'Lv. 12: 마스터 (색상 7x7)', contextId: 'DIFF_L12_COLOR_7x7', rows: 7, cols: 7, timeLimitSeconds: 5, diffType: FindDiffType.color),
|
||||
const FindDiffDifficulty(levelIndex: 13, name: 'Lv. 13: 마스터 (모양 7x7)', contextId: 'DIFF_L13_ICON_7x7', rows: 7, cols: 7, timeLimitSeconds: 5, diffType: FindDiffType.icon),
|
||||
const FindDiffDifficulty(levelIndex: 14, name: 'Lv. 14: 마스터 (회전 7x7)', contextId: 'DIFF_L14_ROT_7x7', rows: 7, cols: 7, timeLimitSeconds: 5, diffType: FindDiffType.rotate),
|
||||
const FindDiffDifficulty(levelIndex: 15, name: 'Lv. 15: 갓모드 (8x8)', contextId: 'DIFF_L15_GOD_8x8', rows: 8, cols: 8, timeLimitSeconds: 4, diffType: FindDiffType.rotate),
|
||||
const FindDiffDifficulty(levelIndex: 1, name: 'Lv. 1: 색상 기초 (2x2)', contextId: 'DIFF_L1_COLOR', rows: 2, cols: 2, timeLimitSeconds: 15, diffType: FindDiffType.color),
|
||||
const FindDiffDifficulty(levelIndex: 2, name: 'Lv. 2: 색상 심화 (3x3)', contextId: 'DIFF_L2_COLOR', rows: 3, cols: 3, timeLimitSeconds: 15, diffType: FindDiffType.color),
|
||||
const FindDiffDifficulty(levelIndex: 3, name: 'Lv. 3: 모양 기초 (3x3)', contextId: 'DIFF_L3_ICON', rows: 3, cols: 3, timeLimitSeconds: 15, diffType: FindDiffType.icon),
|
||||
const FindDiffDifficulty(levelIndex: 4, name: 'Lv. 4: 모양 심화 (4x4)', contextId: 'DIFF_L4_ICON', rows: 4, cols: 4, timeLimitSeconds: 15, diffType: FindDiffType.icon),
|
||||
const FindDiffDifficulty(levelIndex: 5, name: 'Lv. 5: 미세 색상 (4x4)', contextId: 'DIFF_L5_COLOR_HARD', rows: 4, cols: 4, timeLimitSeconds: 15, diffType: FindDiffType.color),
|
||||
const FindDiffDifficulty(levelIndex: 6, name: 'Lv. 6: 회전 (4x4)', contextId: 'DIFF_L6_ROT', rows: 4, cols: 4, timeLimitSeconds: 15, diffType: FindDiffType.rotate),
|
||||
const FindDiffDifficulty(levelIndex: 7, name: 'Lv. 7: 회전 (5x5)', contextId: 'DIFF_L7_ROT', rows: 5, cols: 5, timeLimitSeconds: 15, diffType: FindDiffType.rotate),
|
||||
const FindDiffDifficulty(levelIndex: 8, name: 'Lv. 8: 범주 판단 (4x4)', contextId: 'DIFF_L8_CAT', rows: 4, cols: 4, timeLimitSeconds: 15, diffType: FindDiffType.category),
|
||||
const FindDiffDifficulty(levelIndex: 9, name: 'Lv. 9: 단어 찾기 (3x3)', contextId: 'DIFF_L9_WORD', rows: 3, cols: 3, timeLimitSeconds: 15, diffType: FindDiffType.word),
|
||||
const FindDiffDifficulty(levelIndex: 10, name: 'Lv. 10: 단어 찾기 (4x4)', contextId: 'DIFF_L10_WORD', rows: 4, cols: 4, timeLimitSeconds: 15, diffType: FindDiffType.word),
|
||||
const FindDiffDifficulty(levelIndex: 11, name: 'Lv. 11: 믹스 챌린지 (4x4)', contextId: 'DIFF_L11_MIX', rows: 4, cols: 4, timeLimitSeconds: 15, diffType: FindDiffType.mix),
|
||||
const FindDiffDifficulty(levelIndex: 12, name: 'Lv. 12: 믹스 챌린지 (5x5)', contextId: 'DIFF_L12_MIX', rows: 5, cols: 5, timeLimitSeconds: 15, diffType: FindDiffType.mix),
|
||||
const FindDiffDifficulty(levelIndex: 13, name: 'Lv. 13: 마스터 (6x6)', contextId: 'DIFF_L13_MASTER', rows: 6, cols: 6, timeLimitSeconds: 15, diffType: FindDiffType.mix),
|
||||
const FindDiffDifficulty(levelIndex: 14, name: 'Lv. 14: 그랜드마스터 (7x7)', contextId: 'DIFF_L14_GM', rows: 7, cols: 7, timeLimitSeconds: 15, diffType: FindDiffType.mix),
|
||||
const FindDiffDifficulty(levelIndex: 15, name: 'Lv. 15: 갓모드 (8x8)', contextId: 'DIFF_L15_GOD', rows: 8, cols: 8, timeLimitSeconds: 15, diffType: FindDiffType.mix),
|
||||
];
|
||||
|
||||
static FindDiffDifficulty getLevel(int levelIndex) {
|
||||
|
||||
Reference in New Issue
Block a user