forked from stefanhendriks/Dune-II---The-Maker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.hpp
71 lines (49 loc) · 1.19 KB
/
Game.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef GAME_H
#define GAME_H
#include "Map.hpp"
#include "Unit.hpp"
#include <memory>
#include <SFML/Graphics.hpp>
#include "SelectionBox.hpp"
#include "Mouse.hpp"
#include "FpsCounter.hpp"
#include "ActionManager.hpp"
#include "Player.hpp"
#include "UnitRepository.hpp"
#include "Console.hpp"
struct CreateUnitMessage : public Message{
CreateUnitMessage(Unit::Type type, const Player& player, const sf::Vector2f& position);
const Unit::Type type;
const Player& player;
const sf::Vector2f position;
};
class Game {
const int IDEAL_FPS = 60;
public:
Game();
int execute();
private:
static const sf::Time TimePerFrame;
bool init();
void updateState(sf::Time dt);
void render();
int cleanup();
void selectUnit(Unit &unit);
bool playing;
sf::RenderWindow screen;
sf::Texture terrain;
sf::Texture shroudEdges;
sf::View camera;
SelectionBox box;
std::unique_ptr<Map> map;
Mouse mouse;
FPS_Counter fpsCounter;
std::vector<Player> players;
std::vector<Unit> units;
MessageSystem messages;
Console console;
ActionManager actions;
UnitRepository unitRepository;
sf::Time dt;
};
#endif