Browse Source

doc: minor changes

Michele Caini 3 years ago
parent
commit
4998e90870
3 changed files with 11 additions and 36 deletions
  1. 0 8
      src/entt/entity/group.hpp
  2. 3 8
      src/entt/entity/sparse_set.hpp
  3. 8 20
      src/entt/entity/view.hpp

+ 0 - 8
src/entt/entity/group.hpp

@@ -582,10 +582,6 @@ public:
     /**
      * @brief Sort a group according to the given comparison function.
      *
-     * Sort the group so that iterating it with a couple of iterators returns
-     * entities and components in the expected order. See `begin` and `end` for
-     * more details.
-     *
      * The comparison function object must return `true` if the first element
      * is _less_ than the second one, `false` otherwise. The signature of the
      * comparison function should be equivalent to one of the following:
@@ -982,10 +978,6 @@ public:
     /**
      * @brief Sort a group according to the given comparison function.
      *
-     * Sort the group so that iterating it with a couple of iterators returns
-     * entities and components in the expected order. See `begin` and `end` for
-     * more details.
-     *
      * The comparison function object must return `true` if the first element
      * is _less_ than the second one, `false` otherwise. The signature of the
      * comparison function should be equivalent to one of the following:

+ 3 - 8
src/entt/entity/sparse_set.hpp

@@ -956,14 +956,9 @@ public:
      * @brief Sort entities according to their order in another sparse set.
      *
      * Entities that are part of both the sparse sets are ordered internally
-     * according to the order they have in `other`. All the other entities goes
-     * to the end of the list and there are no guarantees on their order.<br/>
-     * In other terms, this function can be used to impose the same order on two
-     * sets by using one of them as a master and the other one as a slave.
-     *
-     * Iterating the sparse set with a couple of iterators returns elements in
-     * the expected order after a call to `sort_as`. See `begin` and `end` for
-     * more details.
+     * according to the order they have in `other`.<br/>
+     * All the other entities goes to the end of the list and there are no
+     * guarantees on their order.
      *
      * @param other The sparse sets that imposes the order of the entities.
      */

+ 8 - 20
src/entt/entity/view.hpp

@@ -453,9 +453,7 @@ public:
     /**
      * @brief Returns the components assigned to the given entity.
      *
-     * @warning
-     * Attempting to use an entity that doesn't belong to the view results in
-     * undefined behavior.
+     * @sa get
      *
      * @tparam Index Indexes of the components to get.
      * @param entt A valid identifier.
@@ -757,33 +755,23 @@ public:
      * Attempting to use an entity that doesn't belong to the view results in
      * undefined behavior.
      *
-     * @tparam Type Type of the component to get.
+     * @tparam Elem Type or index of the component to get.
      * @param entt A valid identifier.
      * @return The component assigned to the entity.
      */
-    template<typename Type>
+    template<typename Elem>
     [[nodiscard]] decltype(auto) get(const entity_type entt) const {
-        static_assert(std::is_same_v<std::remove_const_t<Type>, typename Get::value_type>, "Invalid component type");
+        static_assert(std::is_same_v<std::remove_const_t<Elem>, typename Get::value_type>, "Invalid component type");
         return get<0>(entt);
     }
 
-    /**
-     * @brief Returns the component assigned to the given entity.
-     *
-     * @warning
-     * Attempting to use an entity that doesn't belong to the view results in
-     * undefined behavior.
-     *
-     * @tparam Index Index of the component to get.
-     * @param entt A valid identifier.
-     * @return The component assigned to the entity.
-     */
-    template<std::size_t... Index>
+    /*! @copydoc get */
+    template<std::size_t... Elem>
     [[nodiscard]] decltype(auto) get(const entity_type entt) const {
-        if constexpr(sizeof...(Index) == 0) {
+        if constexpr(sizeof...(Elem) == 0) {
             return storage().get_as_tuple(entt);
         } else {
-            return storage<Index...>().get(entt);
+            return storage<Elem...>().get(entt);
         }
     }