Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
** EPITECH PROJECT, 2024 |
3 |
|
|
** zappy |
4 |
|
|
** File description: |
5 |
|
|
** home |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
#ifndef HOME_HPP_ |
9 |
|
|
#define HOME_HPP_ |
10 |
|
|
|
11 |
|
|
#include "IScene.hpp" |
12 |
|
|
#include "../ui/Button.hpp" |
13 |
|
|
#include "../ui/Input.hpp" |
14 |
|
|
#include "../ui/Chat.hpp" |
15 |
|
|
#include "../sprites/Sprite.hpp" |
16 |
|
|
#include "../../utils/Lerp.hpp" |
17 |
|
|
#include "../../utils/Random.hpp" |
18 |
|
|
#include "Starlings.hpp" |
19 |
|
|
|
20 |
|
|
#include <memory> |
21 |
|
|
#include <map> |
22 |
|
|
|
23 |
|
|
class Core; |
24 |
|
|
|
25 |
|
|
class Home : public IScene { |
26 |
|
|
public: |
27 |
|
|
Home(Core *core, int port, std::string ip); |
28 |
|
✗ |
~Home() {} |
29 |
|
|
|
30 |
|
|
bool update(sf::Event event, sf::RenderWindow &window) override; |
31 |
|
|
void update(float fElapsedTime) override; |
32 |
|
|
void draw(sf::RenderWindow &window) override; |
33 |
|
✗ |
void init() override {} |
34 |
|
|
bool connectToServer(); |
35 |
|
|
|
36 |
|
|
protected: |
37 |
|
|
private: |
38 |
|
|
|
39 |
|
|
std::shared_ptr<Button> _quitButton; |
40 |
|
|
std::shared_ptr<Button> _startButton; |
41 |
|
|
|
42 |
|
|
std::shared_ptr<Input> _ipButton; |
43 |
|
|
std::shared_ptr<Input> _portButton; |
44 |
|
|
|
45 |
|
|
Core *_core; |
46 |
|
|
|
47 |
|
|
std::shared_ptr<Chat> _chat; |
48 |
|
|
|
49 |
|
|
std::map<std::string, std::shared_ptr<Sprite>> _sprites; |
50 |
|
|
|
51 |
|
|
void initSprites(); |
52 |
|
|
std::vector<Starlings> _starlings; |
53 |
|
|
}; |
54 |
|
|
|
55 |
|
|
#endif /* !HOME_HPP_ */ |
56 |
|
|
|