-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
57 lines (47 loc) · 1.5 KB
/
mainwindow.h
File metadata and controls
57 lines (47 loc) · 1.5 KB
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QMap>
#include "IWordSource.h"
#include "GameManager.h" // IGameManager, LetterResult, GuessResult
#include "GameConfig.h"
// Gerekli sınıfları önceden bildiriyoruz
class QGridLayout;
class QHBoxLayout;
class QVBoxLayout;
class QLabel;
class QPushButton;
class QSequentialAnimationGroup;
class QParallelAnimationGroup;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(IGameManager& gameManager, IWordSource& wordSource, QWidget *parent = nullptr);
~MainWindow();
private slots:
void onLetterPressed(const QString& letter);
void onBackspacePressed();
void onEnterPressed();
private:
void triggerFlipAnimation(const QVector<LetterResult>& result);
void triggerPopAnimation(int row, int col);
void updateKeyboardColors();
// Arayüz elemanlarımız
QWidget* m_centralWidget;
QVBoxLayout* m_mainVerticalLayout;
QLabel* m_gridLabels[GameConfig::MAX_GUESSES][GameConfig::WORD_LENGTH];
// Oyun motoru ve kelime kaynağı (soyut arayüzler üzerinden)
IWordSource& m_wordSource;
IGameManager& m_gameManager;
// Mevcut oyun durumu
int m_currentRow;
int m_currentCol;
bool m_isGameActive;
// Klavye ve animasyon yönetimi
QMap<QChar, QPushButton*> m_keyboardButtons;
QMap<QChar, LetterResult> m_letterStates;
QSequentialAnimationGroup* m_flipAnimationGroup;
QParallelAnimationGroup* m_popAnimationGroup;
};
#endif // MAINWINDOW_H