-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdator.hpp
More file actions
35 lines (33 loc) · 1.09 KB
/
Updator.hpp
File metadata and controls
35 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "TileTagging.hpp"
#ifndef UPDATOR_HEADER_HPP
#define UPDATOR_HEADER_HPP
namespace StrategyGoo
{
struct Updator : public WorldPosition
{
Updator( entt::registry& registry_, BoardPosition start, GameBoard* board_,
size_t tileWidth, size_t tileHeight, std::string spriteName );
template< typename REFRENCE_TYPE, typename CLASS_TYPE >
void InitilizeRefrences( CLASS_TYPE& self ) {
registry.emplace< REFRENCE_TYPE >( id, self );
AddEntityToTile< REFRENCE_TYPE >( registry, self, RefrenceBoardPosition(), board );
}
using UpdatorRefrence = std::reference_wrapper< Updator >;
virtual void Update() = 0;
virtual void UpdateGraphics() {};
BoardPosition& RefrenceBoardPosition();
Sprite< 0 >& RefrenceSprite();
entt::registry& RefrenceRegistry();
entt::entity GetID();
GameBoard* GetBoard();
sf::Vector2f ToWorldPosition() override;
protected:
entt::entity id;
entt::registry& registry;
GameBoard* board;
const size_t ENTITY_TILE_WIDTH_CONSTANT;
const size_t ENTITY_TILE_HEIGHT_CONSTANT;
};
//template void Updator::InitilizeRefrences< UpdatorRefrence >();
}
#endif