36 lines
875 B
C++
36 lines
875 B
C++
|
#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 = {};
|
||
|
|
||
|
void updateCollectables();
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif //HOLESOME_COLLECTABLES_COLLECTION_HPP
|