Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
Types.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem>
4#include <set>
5#include <typeindex>
6
7namespace shkyera {
8
10
11template <typename T, typename... Args>
13 requires(const std::filesystem::path& p, Args&&... args) { T{p, std::forward<decltype(args)>(args)...}; };
14
16 std::size_t operator()(const std::filesystem::path& p) const {
17 std::string absolutePath = std::filesystem::absolute(p);
18 return std::hash<std::string>()(absolutePath);
19 }
20};
21
23 bool operator()(const std::filesystem::path& lhs, const std::filesystem::path& rhs) const {
24 const auto lhsAbsolute = std::filesystem::absolute(lhs);
25 const auto rhsAbsolute = std::filesystem::absolute(rhs);
26 return lhsAbsolute == rhsAbsolute;
27 }
28};
29
30} // namespace shkyera
Definition Types.hpp:12
Definition Asset.hpp:6
RuntimeMode
Definition Types.hpp:9
Definition Clock.hpp:9
Definition Types.hpp:22
bool operator()(const std::filesystem::path &lhs, const std::filesystem::path &rhs) const
Definition Types.hpp:23
Definition Types.hpp:15
std::size_t operator()(const std::filesystem::path &p) const
Definition Types.hpp:16