2023-06-12 21:02:04 +02:00
|
|
|
#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);
|
|
|
|
void remove(const std::shared_ptr<Collectable>& collectable);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static inline std::shared_ptr<CollectablesCollection> singletonInstance = nullptr;
|
|
|
|
|
|
|
|
std::map<int, std::shared_ptr<CollectablesDepthCollection>> depthCollections = {};
|
|
|
|
|
2023-07-01 20:06:53 +02:00
|
|
|
bool isValidDepth(int desiredDepth) const;
|
2023-06-12 21:02:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //HOLESOME_COLLECTABLES_COLLECTION_HPP
|