-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlevel.h
More file actions
55 lines (45 loc) · 1.34 KB
/
level.h
File metadata and controls
55 lines (45 loc) · 1.34 KB
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
#pragma once
#include <map>
#include <vector>
#include <QJsonDocument>
#include "Utilities/vector_f.h"
#include "GameObjects/Entities/Mobs/Basis/mob.h"
#include "GameObjects/Entities/Towers/TowerSlots/tower_slot.h"
#include "Utilities/route.h"
#include "Utilities/wave.h"
#include "GameObjects/Entities/Traps/bear_trap.h"
#include "GameObjects/Entities/Traps/bomb.h"
class Level {
public:
explicit Level(int level_number);
void AddObjectsToScene(GameScene* scene);
void Tick(Time delta);
[[nodiscard]] const std::vector<Route*>& GetRoutes() const;
[[nodiscard]] const std::vector<Wave*>& GetWaves();
[[nodiscard]] int GetLevelNumber() const;
[[nodiscard]] int GetStartMoney() const;
bool IsTimeForGrow();
private:
class SpawnEntry {
public:
explicit SpawnEntry(QJsonObject* spawn_root_object);
[[nodiscard]] Time GetEntryEndTime() const;
void AddMobsToWave(
std::map<Mob*, Time>* mobs,
const std::vector<Route*>& routes) const;
private:
Time start_time_;
QString mob_type_;
int count_;
Time entry_duration_;
int route_index_;
};
std::vector<BearTrap*> bear_traps_{};
std::vector<Bomb*> bombs_{};
std::vector<TowerSlot*> tower_slots_{};
std::vector<Route*> routes_{};
std::vector<Wave*> waves_{};
std::vector<Time> timers_for_grow_{};
int level_number_;
int startMoney_;
};