project-kyoku/modes/classicmode/graphics/classicgraphicsmanager.h

29 lines
875 B
C
Raw Normal View History

2021-12-27 13:41:25 -05:00
#pragma once
#include "spritecontainer.h"
#include "classicmode/classicactions.h"
#include "graphics/classicspritefactory.h"
#include <SFML/Graphics/RenderTarget.hpp>
class ClassicSprite;
class ClassicGraphicsManager : public sf::Drawable
{
public:
virtual ~ClassicGraphicsManager() = default;
explicit ClassicGraphicsManager(const microsec& visibility_offset) :
_sprite_container({Type::UP, Type::DOWN,
Type::LEFT, Type::RIGHT},
std::make_unique<ClassicSpriteFactory>()),
_visibility_offset(visibility_offset)
{}
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const override = 0;
virtual void update(const microsec& offset) = 0;
protected:
SpriteContainer<Type, ClassicSpriteFactory, ClassicSprite> _sprite_container;
microsec _visibility_offset;
};