|
@@ -284,6 +284,11 @@ public:
|
|
|
/*! @brief Reverse iterator type. */
|
|
/*! @brief Reverse iterator type. */
|
|
|
using reverse_iterator = view_iterator<typename basic_sparse_set<entity_type>::reverse_iterator>;
|
|
using reverse_iterator = view_iterator<typename basic_sparse_set<entity_type>::reverse_iterator>;
|
|
|
|
|
|
|
|
|
|
+ /*! @brief Default constructor to use to create empty, invalid views. */
|
|
|
|
|
+ basic_view() ENTT_NOEXCEPT
|
|
|
|
|
+ : view{}
|
|
|
|
|
+ {}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Constructs a multi-type view from a set of storage classes.
|
|
* @brief Constructs a multi-type view from a set of storage classes.
|
|
|
* @param component The storage for the types to iterate.
|
|
* @param component The storage for the types to iterate.
|
|
@@ -395,6 +400,14 @@ public:
|
|
|
return (it != end() && *it == entt) ? it : end();
|
|
return (it != end() && *it == entt) ? it : end();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Checks if a view is properly initialized.
|
|
|
|
|
+ * @return True if the view is properly initialized, false otherwise.
|
|
|
|
|
+ */
|
|
|
|
|
+ [[nodiscard]] explicit operator bool() const ENTT_NOEXCEPT {
|
|
|
|
|
+ return std::get<0>(pools) != nullptr;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Checks if a view contains an entity.
|
|
* @brief Checks if a view contains an entity.
|
|
|
* @param entt A valid entity identifier.
|
|
* @param entt A valid entity identifier.
|
|
@@ -520,7 +533,7 @@ public:
|
|
|
private:
|
|
private:
|
|
|
const std::tuple<storage_type<Component> *...> pools;
|
|
const std::tuple<storage_type<Component> *...> pools;
|
|
|
const std::tuple<const storage_type<Exclude> *...> filter;
|
|
const std::tuple<const storage_type<Exclude> *...> filter;
|
|
|
- mutable const basic_sparse_set<entity_type>* view;
|
|
|
|
|
|
|
+ mutable const basic_sparse_set<entity_type> *view;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
@@ -651,6 +664,11 @@ public:
|
|
|
/*! @brief Reversed iterator type. */
|
|
/*! @brief Reversed iterator type. */
|
|
|
using reverse_iterator = typename basic_sparse_set<Entity>::reverse_iterator;
|
|
using reverse_iterator = typename basic_sparse_set<Entity>::reverse_iterator;
|
|
|
|
|
|
|
|
|
|
+ /*! @brief Default constructor to use to create empty, invalid views. */
|
|
|
|
|
+ basic_view() ENTT_NOEXCEPT
|
|
|
|
|
+ : pool{}
|
|
|
|
|
+ {}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Constructs a single-type view from a storage class.
|
|
* @brief Constructs a single-type view from a storage class.
|
|
|
* @param ref The storage for the type to iterate.
|
|
* @param ref The storage for the type to iterate.
|
|
@@ -791,6 +809,14 @@ public:
|
|
|
return begin()[pos];
|
|
return begin()[pos];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Checks if a view is properly initialized.
|
|
|
|
|
+ * @return True if the view is properly initialized, false otherwise.
|
|
|
|
|
+ */
|
|
|
|
|
+ [[nodiscard]] explicit operator bool() const ENTT_NOEXCEPT {
|
|
|
|
|
+ return pool != nullptr;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Checks if a view contains an entity.
|
|
* @brief Checks if a view contains an entity.
|
|
|
* @param entt A valid entity identifier.
|
|
* @param entt A valid entity identifier.
|
|
@@ -894,7 +920,7 @@ public:
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
private:
|
|
|
- storage_type *pool;
|
|
|
|
|
|
|
+ storage_type * const pool;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|