// // Created by sebastian on 08.02.26. // #include "PlayerInventory.h" #include bool PlayerInventory::hasEnough(RessourceType resourceType, int amount) const { auto it = resources.find(resourceType); return it != resources.end() && it->second >= amount; } void PlayerInventory::spend(RessourceType resourceType, int amount) { if (hasEnough(resourceType, amount)) { resources[resourceType] -= amount; } } void PlayerInventory::add(RessourceType resourceType, int amount) { resources[resourceType] += amount; }