25 lines
462 B
C++
25 lines
462 B
C++
#include <psemek/ecs/detail/query_cache.hpp>
|
|
#include <psemek/ecs/detail/table.hpp>
|
|
|
|
namespace psemek::ecs::detail
|
|
{
|
|
|
|
void query_cache::add(table * table)
|
|
{
|
|
auto & entry = tables.emplace_back();
|
|
entry.table = table;
|
|
|
|
for (auto const & uuid : component_uuids)
|
|
{
|
|
for (std::size_t i = 0; i < table->component_count(); ++i)
|
|
{
|
|
if (uuid == table->get_component_uuids()[i])
|
|
{
|
|
entry.column_ids.push_back(i);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|