Compare commits
No commits in common. "e786cf2d7a04b200b00095f871813a8ada96b65a" and "4baca47f728b6136b80e0d01b71507ef75d3474b" have entirely different histories.
e786cf2d7a
...
4baca47f72
2 changed files with 2 additions and 51 deletions
|
@ -381,10 +381,9 @@ void ResearchTree::generateArchTree() {
|
||||||
void ResearchTree::readEngineUnlocks(Containers::ArrayView<Int> engines, Containers::ArrayView<Int> gears) {
|
void ResearchTree::readEngineUnlocks(Containers::ArrayView<Int> engines, Containers::ArrayView<Int> gears) {
|
||||||
if(engines == nullptr || engines.size() == 0) {
|
if(engines == nullptr || engines.size() == 0) {
|
||||||
Utility::Error{} << "Engines can't be empty";
|
Utility::Error{} << "Engines can't be empty";
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Int engine : engines) {
|
for(Int& engine : engines) {
|
||||||
if(_engineNodes.find(engine) != _engineNodes.end()) {
|
if(_engineNodes.find(engine) != _engineNodes.end()) {
|
||||||
_engineNodes.at(engine).setState(Node::State::Unlocked);
|
_engineNodes.at(engine).setState(Node::State::Unlocked);
|
||||||
}
|
}
|
||||||
|
@ -394,59 +393,13 @@ void ResearchTree::readEngineUnlocks(Containers::ArrayView<Int> engines, Contain
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Int gear : gears) {
|
for(Int& gear : gears) {
|
||||||
if(_engineNodes.find(gear) != _engineNodes.end()) {
|
if(_engineNodes.find(gear) != _engineNodes.end()) {
|
||||||
_engineNodes.at(gear).setState(Node::State::Unlocked);
|
_engineNodes.at(gear).setState(Node::State::Unlocked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResearchTree::readOSUnlocks(Containers::ArrayView<Int> os, Containers::ArrayView<Int> modules) {
|
|
||||||
if(os == nullptr || os.size() == 0) {
|
|
||||||
Utility::Error{} << "OSes can't be empty";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(Int os_id : os) {
|
|
||||||
if(_osNodes.find(os_id) != _osNodes.end()) {
|
|
||||||
_osNodes.at(os_id).setState(Node::State::Unlocked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(modules == nullptr || modules.size() == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(Int module : modules) {
|
|
||||||
if(_osNodes.find(module) != _osNodes.end()) {
|
|
||||||
_osNodes.at(module).setState(Node::State::Unlocked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResearchTree::readArchUnlocks(Containers::ArrayView<Int> archs, Containers::ArrayView<Int> techs) {
|
|
||||||
if(archs == nullptr || archs.size() == 0) {
|
|
||||||
Utility::Error{} << "Archs can't be empty";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(Int arch : archs) {
|
|
||||||
if(_archNodes.find(arch) != _archNodes.end()) {
|
|
||||||
_archNodes.at(arch).setState(Node::State::Unlocked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(techs == nullptr || techs.size() == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(Int tech : techs) {
|
|
||||||
if(_archNodes.find(tech) != _archNodes.end()) {
|
|
||||||
_archNodes.at(tech).setState(Node::State::Unlocked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
auto ResearchTree::getEngineRootNode() -> Node& {
|
auto ResearchTree::getEngineRootNode() -> Node& {
|
||||||
return _engineNodes.at(VerseEngine);
|
return _engineNodes.at(VerseEngine);
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,8 +99,6 @@ class ResearchTree {
|
||||||
void generateArchTree();
|
void generateArchTree();
|
||||||
|
|
||||||
void readEngineUnlocks(Containers::ArrayView<Int> engines, Containers::ArrayView<Int> gears = nullptr);
|
void readEngineUnlocks(Containers::ArrayView<Int> engines, Containers::ArrayView<Int> gears = nullptr);
|
||||||
void readOSUnlocks(Containers::ArrayView<Int> os, Containers::ArrayView<Int> modules = nullptr);
|
|
||||||
void readArchUnlocks(Containers::ArrayView<Int> archs, Containers::ArrayView<Int> techs = nullptr);
|
|
||||||
|
|
||||||
auto getEngineRootNode() -> Node&;
|
auto getEngineRootNode() -> Node&;
|
||||||
auto getOSRootNode() -> Node&;
|
auto getOSRootNode() -> Node&;
|
||||||
|
|
Loading…
Reference in a new issue