-
-
Notifications
You must be signed in to change notification settings - Fork 863
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
135 additions
and
102 deletions.
There are no files selected for viewing
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,37 @@ | ||
#ifndef ENTT_ENTITY_COMPONENT_HPP | ||
#define ENTT_ENTITY_COMPONENT_HPP | ||
|
||
|
||
#include <type_traits> | ||
#include "default_storage.hpp" | ||
|
||
|
||
namespace entt { | ||
|
||
|
||
template<typename> | ||
struct component_traits; | ||
|
||
|
||
template<typename Type, typename = std::void_t<>> | ||
struct component_pool { | ||
template<typename Entity> | ||
using type = default_storage<Entity, Type>; | ||
}; | ||
|
||
|
||
template<typename Type> | ||
struct component_pool<Type, std::void_t<typename component_traits<Type>::pool_type>> { | ||
template<typename Entity> | ||
using type = typename component_traits<Type>::pool_type; | ||
}; | ||
|
||
|
||
template<typename Entity, typename Type> | ||
using component_pool_t = typename component_pool<Type>::template type<Entity>; | ||
|
||
|
||
} | ||
|
||
|
||
#endif // ENTT_ENTITY_COMPONENT_HPP |
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
Oops, something went wrong.