forked from NaiJi/project-kyoku
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
734 B
C++
32 lines
734 B
C++
#pragma once
|
|
|
|
#include "classicactions.h"
|
|
|
|
#include <memory>
|
|
#include <stack>
|
|
|
|
#include <SFML/Graphics/Font.hpp>
|
|
|
|
class ClassicSprite;
|
|
class ClassicNote;
|
|
|
|
/* Move Sprite initialization into factory
|
|
* and make this class template */
|
|
|
|
class SpriteContainer
|
|
{
|
|
public:
|
|
explicit SpriteContainer();
|
|
|
|
std::shared_ptr<ClassicSprite> getSprite(Action action);
|
|
void resetSprite(const std::shared_ptr<ClassicSprite> &sprite, Action action);
|
|
|
|
private:
|
|
void reallocatePoll(Action kind_of_action);
|
|
std::shared_ptr<ClassicSprite> createSprite(Action kind_of_action) const;
|
|
|
|
using SpritePoll = std::stack<std::shared_ptr<ClassicSprite>>;
|
|
std::map<Action, SpritePoll> _sprite_dispatcher;
|
|
sf::Font _font;
|
|
};
|