holesome/src/game/collectables/collection/collectables_collection.hpp

36 lines
861 B
C++
Raw Normal View History

#ifndef HOLESOME_COLLECTABLES_COLLECTION_HPP
#define HOLESOME_COLLECTABLES_COLLECTION_HPP
#include <memory>
#include <map>
#include "collectables_depth_collection.hpp"
/**
* @brief Collection of all collections for each depth.
*/
class CollectablesCollection : public GameObject
{
public:
static std::shared_ptr<CollectablesCollection> getInstance();
void createEmpty(int maxDepth);
void update() override;
void draw(sf::RenderWindow *window) override;
void add(const std::shared_ptr<Collectable>& collectable);
2023-07-09 21:24:50 +02:00
void remove(int collectableId);
private:
static inline std::shared_ptr<CollectablesCollection> singletonInstance = nullptr;
std::map<int, std::shared_ptr<CollectablesDepthCollection>> depthCollections = {};
bool isValidDepth(int desiredDepth) const;
};
#endif //HOLESOME_COLLECTABLES_COLLECTION_HPP