-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFishManager.cpp
More file actions
39 lines (29 loc) · 926 Bytes
/
FishManager.cpp
File metadata and controls
39 lines (29 loc) · 926 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
#include "FishManager.h"
#include "bass.h"
#include "shrimp.h"
#include <memory>
#include <thread>
#include "leviathan.h"
FishManager::FishManager(const float width_limit, const float height_limit){
width = width_limit;
height = height_limit;
allFish.reserve(131);
for (int i = 0; i < 100; i++) {
allFish.push_back(std::make_unique<Shrimp>(width_limit, height_limit));
}
for (int i = 0; i < 25; i++) {
allFish.push_back(std::make_unique<Bass>(&allFish, width_limit, height_limit));
}
for (int i = 0; i < 6; i++) {
allFish.push_back(std::make_unique<Leviathan>(&allFish, 300, i * 400 + 900, width_limit, height_limit));
}
}
std::vector<std::unique_ptr<Fish>> &FishManager::GetAllNPCs() {
return allFish;
}
void FishManager::Update() const {
float deltaTime = GetFrameTime();
for (auto &fish : allFish) {
fish->Update(deltaTime);
}
}