@@ -1,6 +1,7 @@
|
||||
#ifndef LIBCATBOY_ECS_ECS_HPP
|
||||
#define LIBCATBOY_ECS_ECS_HPP
|
||||
|
||||
#include "component_view.hpp"
|
||||
#include "fwd.hpp"
|
||||
#include "sparseSet.hpp"
|
||||
|
||||
@@ -83,6 +84,12 @@ public:
|
||||
if (m_alive.find(entity) == m_alive.end()) throw std::runtime_error("entity is dead");
|
||||
get_set<T>().erase(entity);
|
||||
}
|
||||
public:
|
||||
template <typename... Sum>
|
||||
requires(sizeof...(Sum) >= 1)
|
||||
component_view<Entity, Sum...> view() {
|
||||
return { { (&get_set<Sum>())... } };
|
||||
}
|
||||
private:
|
||||
template <typename T>
|
||||
sparse_set<T>& get_set() {
|
||||
|
||||
Reference in New Issue
Block a user