Skip to content

Commit df955bb

Browse files
author
Thumperrr
committed
Modified ResourceManager to allow different types of keys.
1 parent abeae11 commit df955bb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ResourceManager.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212

1313
namespace chesspp
1414
{
15-
template <class T, class deleter_type = std::default_delete<T>>
15+
template <class T, class key_type, class deleter_type = std::default_delete<T>>
1616
class ResourceManager
1717
{
1818
private:
1919
//no copying
20-
ResourceManager(const ResourceManager<T, deleter_type>&);
21-
ResourceManager<T, deleter_type> &operator=(const ResourceManager<T, deleter_type>&);
20+
ResourceManager(const ResourceManager<T, key_type, deleter_type>&);
21+
ResourceManager<T, deleter_type> &operator=(const ResourceManager<T, key_type, deleter_type>&);
2222

2323
private:
2424
typedef std::unique_ptr<T, deleter_type> ptr_t;
25-
typedef typename std::map<std::string, ptr_t> map_t;
25+
typedef typename std::map<key_type, ptr_t> map_t;
2626
typedef typename map_t::iterator map_i;
2727

2828
protected:

src/TextureManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace chesspp
3131
}
3232
};
3333

34-
class TextureManager : public ResourceManager<sf::Texture, TextureDeleter>
34+
class TextureManager : public ResourceManager<sf::Texture, std::string, TextureDeleter>
3535
{
3636
private:
3737
inline TextureManager() {}

0 commit comments

Comments
 (0)