#include "game.h"
#include <algorithm>

bool bossUnlocked(const Player& player) {
    return std::all_of(player.cores.begin(), player.cores.end(), [](bool owned) { return owned; });
}

bool buyPotion(Player& player) {
    constexpr int price = 8;
    if (player.gold < price) return false;
    player.gold -= price;
    ++player.potions;
    return true;
}

void grantCore(Player& player, Core core) {
    const auto index = static_cast<std::size_t>(core);
    player.cores.at(index) = true;
}
