Selaa lähdekoodia

minor changes

Michele Caini 8 vuotta sitten
vanhempi
commit
1e3723b8bb

+ 1 - 1
.gitignore

@@ -1,2 +1,2 @@
-# QtCreator
 *.user
+TODO

+ 1 - 0
CMakeLists.txt

@@ -106,5 +106,6 @@ add_custom_target(
         AUTHORS
         LICENSE
         README.md
+        TODO
         .travis.yml
 )

+ 1 - 0
src/entt/core/hashed_string.hpp

@@ -2,6 +2,7 @@
 #define ENTT_CORE_HASHED_STRING_HPP
 
 
+#include <cstddef>
 #include <cstdint>
 
 

+ 2 - 0
src/entt/entity/actor.hpp

@@ -22,6 +22,8 @@ template<typename Entity, typename Delta>
 struct Actor {
     /*! @brief Type of registry used internally. */
     using registry_type = Registry<Entity>;
+    /*! @brief Underlying entity identifier. */
+    using entity_type = Entity;
     /*! @brief Type used to provide elapsed time. */
     using delta_type = Delta;
 

+ 3 - 3
src/entt/entity/traits.hpp → src/entt/entity/entt_traits.hpp

@@ -1,5 +1,5 @@
-#ifndef ENTT_ENTITY_ENTT_HPP
-#define ENTT_ENTITY_ENTT_HPP
+#ifndef ENTT_ENTITY_ENTT_TRAITS_HPP
+#define ENTT_ENTITY_ENTT_TRAITS_HPP
 
 
 #include <cstdint>
@@ -93,4 +93,4 @@ struct entt_traits<std::uint64_t> {
 }
 
 
-#endif // ENTT_ENTITY_ENTT_HPP
+#endif // ENTT_ENTITY_ENTT_TRAITS_HPP

+ 1 - 1
src/entt/entity/registry.hpp

@@ -12,8 +12,8 @@
 #include <algorithm>
 #include <type_traits>
 #include "../core/family.hpp"
+#include "entt_traits.hpp"
 #include "sparse_set.hpp"
-#include "traits.hpp"
 #include "view.hpp"
 
 

+ 4 - 4
src/entt/entity/sparse_set.hpp

@@ -9,7 +9,7 @@
 #include <cstddef>
 #include <cassert>
 #include <type_traits>
-#include "traits.hpp"
+#include "entt_traits.hpp"
 
 
 namespace entt {
@@ -56,10 +56,10 @@ template<typename Entity>
 class SparseSet<Entity> {
     using traits_type = entt_traits<Entity>;
 
-    struct Iterator {
+    struct Iterator final {
         using value_type = Entity;
 
-        Iterator(const std::vector<Entity> *direct, std::size_t pos)
+        Iterator(const std::vector<value_type> *direct, std::size_t pos)
             : direct{direct}, pos{pos}
         {}
 
@@ -85,7 +85,7 @@ class SparseSet<Entity> {
         }
 
     private:
-        const std::vector<Entity> *direct;
+        const std::vector<value_type> *direct;
         std::size_t pos;
     };
 

+ 1 - 1
src/entt/entt.hpp

@@ -2,9 +2,9 @@
 #include "core/hashed_string.hpp"
 #include "core/ident.hpp"
 #include "entity/actor.hpp"
+#include "entity/entt_traits.hpp"
 #include "entity/registry.hpp"
 #include "entity/sparse_set.hpp"
-#include "entity/traits.hpp"
 #include "entity/view.hpp"
 #include "locator/locator.hpp"
 #include "process/process.hpp"