File size: 2,062 Bytes
99ddd4c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
export type Language = 'en' | 'ru' | 'es' | 'ar' | 'ko' | 'ja' | 'uz';

export type UserLevel = 'beginner' | 'normal' | 'pro' | 'ultra';

export interface UserProfile {
  name: string;
  hp: number;
  level: number;
  chosenLanguage?: Language;
  unlockedLessons: string[]; // List of lesson IDs
  completedLessons: string[]; // List of lesson IDs
  failedHomeworkLessons: { [lessonId: string]: boolean };
  customHomeworks: { [lessonId: string]: string }; // Custom alternative homework if grade < 4
  highScores: {
    game1: number; // max vertical level in Path & Star
    game2: number; // words found in grid
    game3: number; // speaking correct words
    duels: number; // duels won
  };
  savedTopics?: string[]; // List of custom studied topics
  email?: string;
  photoURL?: string;
  subscription?: 'free' | 'pro' | 'ultimate';
  lastAiTopicAskedAt?: number;
  learnedWords?: string[]; // List of Uzbek words learned this week so they don't repeat
  vocabHistory?: string[]; // English words already introduced to prevent repetition
  vocabLoginDays?: string[]; // List of calendar dates (YYYY-MM-DD) when vocab was checked
  vocabGeneratedDays?: { [dayName: string]: { theme: string; words: any[] } }; // Daily AI words
}

export interface Question {
  sentence: string;
  options: string[];
  correctOption: number;
}

export interface Exercise {
  title: string;
  questions: Question[];
}

export interface LessonData {
  explanation: string;
  exercises: Exercise[];
  homework: string;
}

export interface Lesson {
  id: string;
  title: string;
  topic: string;
  level: 'beginner' | 'normal' | 'pro';
  hpReward: number;
  data?: LessonData;
}

export type ChessPieceColor = 'w' | 'b';
export type ChessPieceType = 'p' | 'r' | 'n' | 'b' | 'q' | 'k';

export interface ChessPiece {
  type: ChessPieceType;
  color: ChessPieceColor;
  id: string; // for key tracking
}

export type BoardState = (ChessPiece | null)[][];

export interface DuelQuestion {
  question: string;
  options: string[];
  correctIndex: number;
  explanation: string;
}