-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCrack.hpp
57 lines (47 loc) · 1.17 KB
/
Crack.hpp
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 CRACK_HPP
#define CRACK_HPP
// #include "MainScreen.hpp"
#include <QWidget>
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QStackedWidget>
#include <iostream>
#include <string.h>
#include <vector>
#include <random>
#include <QPushButton>
#include "Inventory.hpp"
#include "Pet.hpp"
class Crack : public QWidget
{
public:
Crack(QWidget *parent, QStackedWidget *stackedWidget, Inventory *inventory);
// function:
void returnToMain();
private slots:
void on_returnButton_clicked();
void crackEggButton();
private:
QStackedWidget *stackedWidget;
QLabel *imageLabel;
// Create egg and coin count labels
QLabel *egg_count_label;
QLabel *coin_count_label;
QLabel *label; // text label
Inventory *inventory;
QPushButton *crackEgg;
QPushButton *returnButton;
// random pets
int rand_rarity;
std::vector<Pet> pet_list;
Pet random_pet;
QPixmap random_pet_sprite;
// std::vector<Pet> user_list;
int loop = 0;
void updateLoop();
void updatePetSprites();
int generateNumber();
Pet generateRandomPet(std::vector<Pet> petlist, int rarity);
};
#endif // SCREEN1_HPP