...
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class GameInfo {
|
||||
final String id;
|
||||
final String name;
|
||||
final String description;
|
||||
final IconData icon;
|
||||
final bool isSinglePlayerSupported; // 싱글 플레이 지원 여부
|
||||
|
||||
const GameInfo({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.description,
|
||||
required this.icon,
|
||||
this.isSinglePlayerSupported = false,
|
||||
});
|
||||
}
|
||||
|
||||
class AppGames {
|
||||
static const List<GameInfo> games = [
|
||||
GameInfo(
|
||||
id: 'quiz_mix',
|
||||
name: 'OX 서바이벌',
|
||||
description: '최후의 1인이 될 때까지!\n다함께 푸는 퀴즈 서바이벌',
|
||||
icon: Icons.quiz,
|
||||
isSinglePlayerSupported: true,
|
||||
),
|
||||
GameInfo(
|
||||
id: 'sudoku_battle',
|
||||
name: '스도쿠 배틀',
|
||||
description: '먼저 완성하면 승리!\n상대를 방해하며 퍼즐을 푸세요.',
|
||||
icon: Icons.grid_on,
|
||||
isSinglePlayerSupported: true, // 연습 모드 가능
|
||||
),
|
||||
// 추후 추가 예정 게임들 (비활성화 상태로 표시하거나 주석 처리)
|
||||
GameInfo(
|
||||
id: 'spider_battle',
|
||||
name: '스파이더 카드',
|
||||
description: '카드 정렬의 달인을 찾아라!',
|
||||
icon: Icons.style,
|
||||
isSinglePlayerSupported: true, // 연습 모드 가능
|
||||
),
|
||||
GameInfo(
|
||||
id: 'omok',
|
||||
name: '오목',
|
||||
description: '먼저 5줄을 만들면 승리!\n흑백의 치열한 두뇌 싸움',
|
||||
icon: Icons.circle_outlined,
|
||||
isSinglePlayerSupported: false, // 1:1 전용
|
||||
),
|
||||
// [추가] 장기
|
||||
GameInfo(
|
||||
id: 'janggi',
|
||||
name: '장기',
|
||||
description: '한국 전통 보드게임\n초(楚)와 한(漢)의 승부',
|
||||
icon: Icons.games,
|
||||
isSinglePlayerSupported: false, // 1:1 전용
|
||||
),
|
||||
GameInfo(
|
||||
id: 'yutnori',
|
||||
name: '윷놀이',
|
||||
description: '던져라 윷! 잡아라 말!\n역전의 드라마 명절 게임',
|
||||
icon: Icons.kebab_dining, // 윷가락과 비슷한 아이콘 사용
|
||||
isSinglePlayerSupported: false,
|
||||
),
|
||||
GameInfo(
|
||||
id: 'memory_battle',
|
||||
name: '그림 찾기',
|
||||
description: '기억력 대결!\n짝을 더 많이 찾는 사람이 승리',
|
||||
icon: Icons.flip,
|
||||
isSinglePlayerSupported: false,
|
||||
),
|
||||
// [추가] 밸런스 게임
|
||||
GameInfo(
|
||||
id: 'balance_game',
|
||||
name: '밸런스 게임',
|
||||
description: '우리는 천생연분?\n동시에 같은 답을 골라보세요!',
|
||||
icon: Icons.favorite,
|
||||
isSinglePlayerSupported: false,
|
||||
),
|
||||
// [추가] 터치 배틀
|
||||
GameInfo(
|
||||
id: 'tap_battle',
|
||||
name: '터치 배틀',
|
||||
description: '단순 무식 스피드 대결!\n누가 더 빨리 누를까?',
|
||||
icon: Icons.touch_app,
|
||||
isSinglePlayerSupported: false,
|
||||
),
|
||||
];
|
||||
|
||||
static GameInfo getById(String id) {
|
||||
return games.firstWhere((g) => g.id == id, orElse: () => games.first);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
enum QuizType { text, image }
|
||||
|
||||
class QuizItem {
|
||||
final QuizType type;
|
||||
final String category; // [추가] 카테고리
|
||||
final String question;
|
||||
final String answer;
|
||||
final List<String> options;
|
||||
|
||||
QuizItem({
|
||||
required this.type,
|
||||
required this.category, // [추가]
|
||||
required this.question,
|
||||
required this.answer,
|
||||
required this.options,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'type': type.name,
|
||||
'category': category, // [추가]
|
||||
'question': question,
|
||||
'answer': answer,
|
||||
'options': options,
|
||||
};
|
||||
|
||||
factory QuizItem.fromJson(Map<String, dynamic> json) {
|
||||
return QuizItem(
|
||||
type: json['type'] == 'image' ? QuizType.image : QuizType.text,
|
||||
category: json['category'] ?? '기타', // [추가] 없을 경우 대비
|
||||
question: json['question'],
|
||||
answer: json['answer'],
|
||||
options: List<String>.from(json['options'] ?? []),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class QuizSet {
|
||||
static List<QuizItem> getStandard50() {
|
||||
return [
|
||||
// 1~10: 믹스
|
||||
QuizItem(type: QuizType.text, category: "상식", question: "사과는 영어로 Apple이다.", answer: "O", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "북극곰의 피부색은 흰색이다.", answer: "X", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "돌고래는 '어류(물고기)'다.", answer: "X", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "역사", question: "임진왜란이 일어난 해는?", answer: "1592년", options: ["1392년", "1492년", "1592년", "1950년"]),
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "왕이 넘어지면?", answer: "킹콩", options: ["왕콩", "킹콩", "전하", "꽈당"]),
|
||||
QuizItem(type: QuizType.text, category: "속담", question: "가는 말이 고와야 [ ? ]가 곱다.", answer: "오는 말", options: ["오는 말", "가는 발", "너의 말", "우리 말"]),
|
||||
QuizItem(type: QuizType.text, category: "수학", question: "5 + 5 × 5 = ?", answer: "30", options: ["25", "30", "50", "10"]),
|
||||
QuizItem(type: QuizType.text, category: "수도", question: "미국의 수도는 어디일까요?", answer: "워싱턴 D.C.", options: ["뉴욕", "LA", "워싱턴 D.C.", "시카고"]),
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "세상에서 가장 뜨거운 바다는?", answer: "열바다", options: ["불바다", "열바다", "사랑해", "동해"]),
|
||||
QuizItem(type: QuizType.text, category: "기타", question: "개발자님은 이 앱을 완성할 수 있다!", answer: "O", options: ["O", "X"]),
|
||||
|
||||
// 11~20: 동물
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "낙지의 심장은 3개다.", answer: "O", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "펭귄은 북극에 산다.", answer: "X", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "상어는 부레가 없다.", answer: "O", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "토끼는 눈을 뜨고 잔다.", answer: "O", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "기린의 목뼈 개수는 사람보다 훨씬 많다.", answer: "X", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "금붕어의 기억력은 3초다.", answer: "X", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "달팽이도 이빨이 있다.", answer: "O", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "뱀은 뒤로 갈 수 있다.", answer: "X", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "고양이는 단맛을 느끼지 못한다.", answer: "O", options: ["O", "X"]),
|
||||
QuizItem(type: QuizType.text, category: "동물", question: "지구에서 가장 큰 동물은 코끼리다.", answer: "X", options: ["O", "X"]),
|
||||
|
||||
// 21~30: 수도
|
||||
QuizItem(type: QuizType.text, category: "수도", question: "호주의 수도는?", answer: "캔버라", options: ["시드니", "멜버른", "캔버라", "퍼스"]),
|
||||
QuizItem(type: QuizType.text, category: "수도", question: "캐나다의 수도는?", answer: "오타와", options: ["토론토", "밴쿠버", "몬트리올", "오타와"]),
|
||||
QuizItem(type: QuizType.text, category: "수도", question: "베트남의 수도는?", answer: "하노이", options: ["호치민", "하노이", "다낭", "나트랑"]),
|
||||
QuizItem(type: QuizType.text, category: "수도", question: "터키(튀르키예)의 수도는?", answer: "앙카라", options: ["이스탄불", "앙카라", "이즈미르", "안탈리아"]),
|
||||
QuizItem(type: QuizType.text, category: "수도", question: "브라질의 수도는?", answer: "브라질리아", options: ["상파울루", "리우데자네이루", "브라질리아", "살바도르"]),
|
||||
QuizItem(type: QuizType.text, category: "수도", question: "스페인의 수도는?", answer: "마드리드", options: ["바르셀로나", "마드리드", "세비야", "발렌시아"]),
|
||||
QuizItem(type: QuizType.text, category: "수도", question: "독일의 수도는?", answer: "베를린", options: ["뮌헨", "프랑크푸르트", "베를린", "함부르크"]),
|
||||
QuizItem(type: QuizType.text, category: "수도", question: "이집트의 수도는?", answer: "카이로", options: ["카이로", "알렉산드리아", "룩소르", "아스완"]),
|
||||
QuizItem(type: QuizType.text, category: "수도", question: "인도의 수도는?", answer: "뉴델리", options: ["뭄바이", "뉴델리", "방갈로르", "콜카타"]),
|
||||
QuizItem(type: QuizType.text, category: "수도", question: "스위스의 수도는?", answer: "베른", options: ["취리히", "제네바", "베른", "바젤"]),
|
||||
|
||||
// 31~40: 넌센스
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "세상에서 가장 추운 바다는?", answer: "썰렁해", options: ["동해", "썰렁해", "북극해", "냉해"]),
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "차가 울면?", answer: "잉카", options: ["엉엉", "부릉부릉", "잉카", "흑흑"]),
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "반성문을 영어로 하면?", answer: "글로벌", options: ["쏘리", "글로벌", "미스테이크", "리포트"]),
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "딸기가 도망가면?", answer: "딸기쨈", options: ["딸기시럽", "딸기주스", "딸기쨈", "딸기런"]),
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "우유가 아프면?", answer: "앙팡", options: ["서울우유", "앙팡", "매일우유", "아야"]),
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "세상에서 가장 가난한 왕은?", answer: "최저임금", options: ["세종대왕", "최저임금", "버거킹", "제왕"]),
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "비가 1시간 동안 내리면?", answer: "추적60분", options: ["장마", "소나기", "추적60분", "비와이"]),
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "도둑이 훔친 돈을 영어로?", answer: "슬그머니", options: ["머니머니", "슬그머니", "스틸머니", "블랙머니"]),
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "오리가 얼면?", answer: "언덕", options: ["빙판", "언덕", "동동", "꽥꽥"]),
|
||||
QuizItem(type: QuizType.text, category: "넌센스", question: "전주비빔밥보다 맛있는 비빔밥은?", answer: "이번주비빔밥", options: ["돌솥비빔밥", "산채비빔밥", "이번주비빔밥", "육회비빔밥"]),
|
||||
|
||||
// 41~50: 상식
|
||||
QuizItem(type: QuizType.text, category: "상식", question: "피카소의 국적은?", answer: "스페인", options: ["프랑스", "이탈리아", "스페인", "독일"]),
|
||||
QuizItem(type: QuizType.text, category: "역사", question: "대한민국 임시정부가 수립된 연도는?", answer: "1919년", options: ["1910년", "1919년", "1945년", "1948년"]),
|
||||
QuizItem(type: QuizType.text, category: "수학", question: "원주율(π)의 근사값은?", answer: "3.14", options: ["3.14", "3.15", "3.12", "3.16"]),
|
||||
QuizItem(type: QuizType.text, category: "상식", question: "축구 경기 한 팀의 선수는 몇 명인가?", answer: "11명", options: ["9명", "10명", "11명", "12명"]),
|
||||
QuizItem(type: QuizType.text, category: "상식", question: "세계에서 가장 인구가 많은 나라는? (2023년 기준)", answer: "인도", options: ["중국", "미국", "인도", "인도네시아"]),
|
||||
QuizItem(type: QuizType.text, category: "상식", question: "비빔밥에 들어가지 않는 것은?", answer: "초콜릿", options: ["고추장", "참기름", "밥", "초콜릿"]),
|
||||
QuizItem(type: QuizType.text, category: "상식", question: "다음 중 발효 식품이 아닌 것은?", answer: "두부", options: ["김치", "된장", "요거트", "두부"]),
|
||||
QuizItem(type: QuizType.text, category: "상식", question: "음악의 아버지는 누구인가?", answer: "바흐", options: ["모차르트", "베토벤", "바흐", "슈베르트"]),
|
||||
QuizItem(type: QuizType.text, category: "상식", question: "해리포터가 다니는 마법 학교 이름은?", answer: "호그와트", options: ["호그와트", "아즈카반", "그리핀도르", "슬리데린"]),
|
||||
QuizItem(type: QuizType.text, category: "기타", question: "마지막 문제입니다. 개발자가 좋아하는 요일은?", answer: "금요일", options: ["월요일", "수요일", "목요일", "금요일"]),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
enum SpiderSuit { spade, heart, club, diamond }
|
||||
|
||||
class SpiderCard {
|
||||
final int id;
|
||||
final SpiderSuit suit;
|
||||
final int rank;
|
||||
bool isFaceUp;
|
||||
|
||||
SpiderCard({
|
||||
required this.id,
|
||||
required this.suit,
|
||||
required this.rank,
|
||||
this.isFaceUp = false,
|
||||
});
|
||||
|
||||
// 랭크: 1(A) ~ 13(K)
|
||||
String get rankText {
|
||||
switch (rank) {
|
||||
case 1: return 'A';
|
||||
case 11: return 'J';
|
||||
case 12: return 'Q';
|
||||
case 13: return 'K';
|
||||
default: return rank.toString();
|
||||
}
|
||||
}
|
||||
|
||||
bool get isRed => suit == SpiderSuit.heart || suit == SpiderSuit.diamond;
|
||||
|
||||
String get suitSymbol {
|
||||
switch (suit) {
|
||||
case SpiderSuit.spade: return '♠';
|
||||
case SpiderSuit.heart: return '♥';
|
||||
case SpiderSuit.club: return '♣';
|
||||
case SpiderSuit.diamond: return '♦';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
class SudokuGameDto {
|
||||
final int puzzleId;
|
||||
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'] ?? 0,
|
||||
question: json['question'] ?? '',
|
||||
solution: json['solution'] ?? '',
|
||||
blockSize: bs,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'puzzleId': puzzleId,
|
||||
'question': question,
|
||||
'solution': solution,
|
||||
'blockSize': blockSize,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user