-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbattlewindow.h
More file actions
64 lines (50 loc) · 1.51 KB
/
battlewindow.h
File metadata and controls
64 lines (50 loc) · 1.51 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
58
59
60
61
62
63
64
#ifndef BATTLEWINDOW_H
#define BATTLEWINDOW_H
#include <QWidget>
#include "character.h"
#include "qboxlayout.h"
#include <QLabel>
#include <QPushButton>
class BattleWindow : public QWidget
{
Q_OBJECT
public:
// Adiciona o tipo de inimigo ao construtor da clase
BattleWindow(QWidget *parent, const QString &enemyType);
// Define os personagens que participarão da batalha
void setCharacters(Character *player, Character *enemy);
private slots:
// Slots para lidar com eventos de batalha
void startBattle();
void attack();
void usePotion();
void initStep();
void updateHealthLabels();
void checkBattleResult();
signals:
// Sinal emitido quando a batalha é iniciada com os personagens definidos
void battleStarted(Character *player, Character *enemy);
void battleFinished();
private:
// Personagens envolvidos na batalha
Character *player;
Character *enemy;
// Rótulos para exibir informações durante a batalha
QLabel *infoLabel;
QLabel *playerHealthLabel;
QLabel *enemyHealthLabel;
QLabel *enemyImgLabel;
QLabel *hpMessage;
QLabel *resultAttackLabel;
// Botões para ações durante a batalha
QPushButton *startButton;
QPushButton *attackButton;
QPushButton *potionButton;
// Layout para organizar os botões de ação
QVBoxLayout *actionButtonLayout;
// Número de poções que o jogador possui
int playerPotions;
// Armazena o tipo de inimigo
QString enemyType;
};
#endif // BATTLEWINDOW_H