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

38 lines
956 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);
void remove(const std::shared_ptr<Collectable>& collectable);
std::shared_ptr<CollectablesDepthCollection> getDepthCollection(int depth);
private:
static inline std::shared_ptr<CollectablesCollection> singletonInstance = nullptr;
std::map<int, std::shared_ptr<CollectablesDepthCollection>> depthCollections = {};
void updateCollectables();
};
#endif //HOLESOME_COLLECTABLES_COLLECTION_HPP