-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented fixes to areas of the engine
- Loading branch information
1 parent
ee995b8
commit 387cfca
Showing
24 changed files
with
182 additions
and
42 deletions.
There are no files selected for viewing
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "vtpch.h" | ||
#include "EntityID.h" | ||
|
||
#include <random> | ||
|
||
namespace Volt | ||
{ | ||
static std::random_device s_randomDevice; | ||
static std::mt19937 s_engine32(s_randomDevice()); | ||
static std::uniform_int_distribution<uint32_t> s_uniformDistribution32; | ||
|
||
EntityID::EntityID() | ||
: m_uuid(s_uniformDistribution32(s_engine32)) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,35 @@ | ||
#pragma once | ||
|
||
#include "Volt/Core/UUID.h" | ||
|
||
namespace Volt | ||
{ | ||
typedef UUID32 EntityID; | ||
class EntityID | ||
{ | ||
public: | ||
EntityID(); | ||
constexpr EntityID(uint32_t uuid) | ||
: m_uuid(uuid) | ||
{ | ||
} | ||
|
||
EntityID(const EntityID&) = default; | ||
~EntityID() = default; | ||
|
||
operator uint32_t() const { return m_uuid; } | ||
private: | ||
uint32_t m_uuid; | ||
}; | ||
} | ||
|
||
namespace std | ||
{ | ||
template <typename T> struct hash; | ||
|
||
template<> | ||
struct hash<Volt::EntityID> | ||
{ | ||
std::size_t operator()(const Volt::EntityID& uuid) const | ||
{ | ||
return (uint32_t)uuid; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.