GPR5100 - Rollback
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
core::SpriteManager Class Reference

SpriteManager is a ComponentManager that manages sprites, order by greater entity index, background entity < foreground entity Positions are centered at the center of the render target and use pixelPerMeter from globals.h. More...

#include <sprite.h>

Inheritance diagram for core::SpriteManager:
Inheritance graph
[legend]
Collaboration diagram for core::SpriteManager:
Collaboration graph
[legend]

Public Member Functions

 SpriteManager (EntityManager &entityManager, TransformManager &transformManager)
 
void SetOrigin (Entity entity, sf::Vector2f origin)
 
void SetTexture (Entity entity, const sf::Texture &texture)
 
void SetCenter (sf::Vector2f center)
 
void SetWindowSize (sf::Vector2f newWindowSize)
 
void Draw (sf::RenderTarget &window) override
 
void SetColor (Entity entity, sf::Color color)
 
- Public Member Functions inherited from core::ComponentManager< sf::Sprite, static_cast< Component >(ComponentType::SPRITE)>
 ComponentManager (EntityManager &entityManager)
 
 ComponentManager (const ComponentManager &)=delete
 
 ComponentManager (ComponentManager &&)=delete
 
ComponentManageroperator= (ComponentManager &)=delete
 
ComponentManageroperator= (ComponentManager &&)=delete
 
virtual void AddComponent (Entity entity)
 AddComponent is a method that sets the flag C in the EntityManager and resize if need the components_ array. More...
 
virtual void RemoveComponent (Entity entity)
 RemoveComponent is a method that unsets the flag C in the EntityManager. More...
 
const sf::Sprite & GetComponent (Entity entity) const
 GetComponent is a method that gets a constant reference to a Component given the Entity. More...
 
sf::Sprite & GetComponent (Entity entity)
 GetComponent is a method that gets a reference to a Component given the Entity. More...
 
void SetComponent (Entity entity, const sf::Sprite &value)
 SetComponent is a method that sets a new value of the Component of an Entity. More...
 
const std::vector< sf::Sprite > & GetAllComponents () const
 GetAllComponents is a method that returns the internal array of components. More...
 
void CopyAllComponents (const std::vector< sf::Sprite > &components)
 CopyAllComponents is a method that changes the internal components array by copying a newly provided one. It is used by the RollbackManager when reverting the current game world data with the last validated game world data. More...
 
virtual void Draw (sf::RenderTarget &renderTarget)=0
 

Protected Attributes

TransformManagertransformManager_
 
sf::Vector2f center_ {}
 
sf::Vector2f windowSize_ {}
 
- Protected Attributes inherited from core::ComponentManager< sf::Sprite, static_cast< Component >(ComponentType::SPRITE)>
EntityManagerentityManager_
 
std::vector< sf::Sprite > components_
 

Detailed Description

SpriteManager is a ComponentManager that manages sprites, order by greater entity index, background entity < foreground entity Positions are centered at the center of the render target and use pixelPerMeter from globals.h.

Member Function Documentation

◆ Draw()

void core::SpriteManager::Draw ( sf::RenderTarget &  window)
overridevirtual

Implements core::DrawInterface.


The documentation for this class was generated from the following files: