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
7
namespace
shkyera
{
8
9
enum class
RuntimeMode
{
DEVELOPMENT
,
PRODUCTION
};
10
11
template
<
typename
T,
typename
... Args>
12
concept
PathConstructible
=
13
requires
(
const
std::filesystem::path& p, Args&&... args) { T{p, std::forward<decltype(args)>(args)...}; };
14
15
struct
GlobalPathHash
{
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
22
struct
GlobalPathEqual
{
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
shkyera::PathConstructible
Definition
Types.hpp:12
shkyera
Definition
Asset.hpp:6
shkyera::RuntimeMode
RuntimeMode
Definition
Types.hpp:9
shkyera::RuntimeMode::PRODUCTION
@ PRODUCTION
shkyera::RuntimeMode::DEVELOPMENT
@ DEVELOPMENT
shkyera::Clock
Definition
Clock.hpp:9
shkyera::GlobalPathEqual
Definition
Types.hpp:22
shkyera::GlobalPathEqual::operator()
bool operator()(const std::filesystem::path &lhs, const std::filesystem::path &rhs) const
Definition
Types.hpp:23
shkyera::GlobalPathHash
Definition
Types.hpp:15
shkyera::GlobalPathHash::operator()
std::size_t operator()(const std::filesystem::path &p) const
Definition
Types.hpp:16
src
Common
Types.hpp
Generated by
1.9.8
Franciszek Szewczyk © 2023