WORK IN PROGRESS

TODO: implement random level generation
moved exclude from list to position.h
distinguished level and map
This commit is contained in:
2024-07-12 00:16:08 -04:00
parent c68330b3e3
commit b3300b8e7c
13 changed files with 268 additions and 113 deletions

View File

@ -110,24 +110,6 @@ result character::apply(direction &dir, const potion_list &potions) {
return result::fine;
}
position_list remove_from_list(const position_list &sorted_positions,
position_list excluded) {
std::sort(excluded.begin(), excluded.end());
position_list 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;
}
// IMPORTANT: remember to check if player is on the stairs
result character::move(const direction dir,
const position_list &available_positions) {