WORK IN PROGRESS
TODO: implement random level generation moved exclude from list to position.h distinguished level and map
This commit is contained in:
@ -43,3 +43,24 @@ size_t find(const std::vector<position> &sorted_list,
|
||||
|
||||
return sorted_list.size();
|
||||
}
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
std::vector<position> remove_from_list(const std::vector<position>
|
||||
&sorted_positions,
|
||||
std::vector<position> excluded) {
|
||||
std::sort(excluded.begin(), excluded.end());
|
||||
|
||||
std::vector<position> result{sorted_positions.size() - excluded.size()};
|
||||
|
||||
auto exc = excluded.begin();
|
||||
|
||||
for (auto src : sorted_positions) {
|
||||
if (exc != excluded.end() && src == *exc)
|
||||
++exc;
|
||||
else
|
||||
result.push_back(src);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user