-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestScripts.cpp
More file actions
57 lines (47 loc) · 1.42 KB
/
Copy pathQuestScripts.cpp
File metadata and controls
57 lines (47 loc) · 1.42 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
56
57
#include "QuestScripts.h"
#include "GameObjectManager.h"
#include "Inventory.h"
#include <iostream>
#include <chrono>
#include <thread>
namespace ZL
{
std::function<void(GameObjectManager&, size_t)> createRoom1Logic()
{
return [elapsedTime = 0u](GameObjectManager& gom, size_t ms) mutable
{
if (gom.bearName.compare("TOM") == 0) {
elapsedTime += ms;
if (elapsedTime >= 2000) {
gInventoryMap.clear();
gom.switch_room(1);
}
} else if (gom.selectedCubes.size() >= 3 && gom.bearName.compare("TOM") != 0) {
std::cout << "Else" << std::endl;
elapsedTime += ms;
if (elapsedTime >= 2000) {
gom.bearName = "";
for (const auto& cube : gom.selectedCubes) {
gInventoryMap[cube.name] = cube;
}
gom.selectedCubes.clear();
elapsedTime = 0;
}
}
};
}
std::function<void(GameObjectManager&, size_t)> createRoom2Logic()
{
return [](GameObjectManager& gom, size_t ms)
// Simple test logic
{
};
}
std::function<void(GameObjectManager&, size_t)> createRoom3Logic()
{
return [](GameObjectManager& gom, size_t ms)
// Simple test logic
{
};
}
}