Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
** EPITECH PROJECT, 2024 |
3 |
|
|
** zappy |
4 |
|
|
** File description: |
5 |
|
|
** Bubble |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
#ifndef BUBBLE_HPP_ |
9 |
|
|
#define BUBBLE_HPP_ |
10 |
|
|
|
11 |
|
|
#include <SFML/Graphics.hpp> |
12 |
|
|
#include <memory> |
13 |
|
|
#include <functional> |
14 |
|
|
|
15 |
|
✗ |
class Bubble { |
16 |
|
|
public: |
17 |
|
✗ |
Bubble(std::string text, sf::Vector2f pos) { |
18 |
|
✗ |
_text = text; |
19 |
|
✗ |
_text = text.substr(0, 20); |
20 |
|
✗ |
_pos = pos; |
21 |
|
✗ |
} |
22 |
|
|
~Bubble() { |
23 |
|
✗ |
} |
24 |
|
|
|
25 |
|
|
void update(float fElapsedTime) { |
26 |
|
✗ |
_time += fElapsedTime; |
27 |
|
|
} |
28 |
|
|
|
29 |
|
|
bool isFinished() { |
30 |
|
✗ |
if (_time > 2) |
31 |
|
|
return true; |
32 |
|
|
return false; |
33 |
|
|
} |
34 |
|
|
|
35 |
|
✗ |
sf::Vector2f getPos() { return _pos; } |
36 |
|
✗ |
std::string getMessage() { return _text; } |
37 |
|
|
|
38 |
|
|
protected: |
39 |
|
|
private: |
40 |
|
|
std::string _text; |
41 |
|
|
sf::Vector2f _pos; |
42 |
|
|
float _time = 0; |
43 |
|
|
}; |
44 |
|
|
|
45 |
|
|
#endif /* !BUBBLE_HPP_ */ |
46 |
|
|
|