-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameComponents.h
More file actions
42 lines (34 loc) · 885 Bytes
/
GameComponents.h
File metadata and controls
42 lines (34 loc) · 885 Bytes
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
#pragma once
#include "Bullet.h"
#include "Container.h"
#include "Enemy.h"
#include "Player.h"
#include "Slide.h"
#include "Score.h"
#include "Sounds.h"
#include "Sprite.h"
#include "Singleton.h"
#include "Projector.h"
#include "Timer.h"
#include <tuple>
#include "Canvas.h"
class GameComponents : public Singleton<GameComponents>
{
friend Singleton<GameComponents>;
public:
std::tuple<Player&, Container<Bullet>&, Container<Enemy>&> getAllComponents();
Container<Bullet>& getBullets();
Sounds& getSound() noexcept;
Score& getScore() noexcept;
const Canvas& getCanvas() noexcept;
Timer& getTimer() noexcept;
private:
Sounds sounds;
Score score;
Canvas canvas;
Player player = { Sprites::get().player, Position(0, 0), Size(0, 0) };
Container<Bullet> bullets;
Container<Enemy> enemies;
Timer timer;
GameComponents();
};