forked from miki151/keeperrl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_info.cpp
More file actions
25 lines (22 loc) · 800 Bytes
/
build_info.cpp
File metadata and controls
25 lines (22 loc) · 800 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
#include "stdafx.h"
#include "build_info.h"
#include "collective.h"
#include "technology.h"
bool BuildInfo::meetsRequirement(const Collective* col, Requirement req) {
return req.visit(
[&](TechId techId) { return col->getTechnology().researched.count(techId);},
[&](BuildInfo::DungeonLevel level) { return col->getDungeonLevel().level + 1>= level; }
);
}
string BuildInfo::getRequirementText(Requirement req) {
return req.visit(
[&](TechId techId) { return "technology: "_s + techId.data();},
[&](BuildInfo::DungeonLevel level) { return "at least level " + toString(level); }
);
}
bool BuildInfo::canSelectRectangle() const {
return type.visit<bool>(
[](const auto&) { return true; },
[](const BuildInfoTypes::PlaceItem&) { return false; }
);
}