index_to_entity is useless
This commit is contained in:
parent
bda170bf6d
commit
46e66aff12
1 changed files with 0 additions and 4 deletions
|
@ -97,7 +97,6 @@ namespace zecsy
|
||||||
std::vector<uint8_t> data;
|
std::vector<uint8_t> data;
|
||||||
std::vector<size_t> free_list;
|
std::vector<size_t> free_list;
|
||||||
std::unordered_map<entity_id, size_t> entity_to_index;
|
std::unordered_map<entity_id, size_t> entity_to_index;
|
||||||
std::unordered_map<size_t, entity_id> index_to_entity;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unordered_map<comp_id, component_pool> pools;
|
std::unordered_map<comp_id, component_pool> pools;
|
||||||
|
@ -198,7 +197,6 @@ namespace zecsy
|
||||||
auto& pool = pools[id];
|
auto& pool = pools[id];
|
||||||
auto index = pool.entity_to_index[e];
|
auto index = pool.entity_to_index[e];
|
||||||
pool.entity_to_index.erase(e);
|
pool.entity_to_index.erase(e);
|
||||||
pool.index_to_entity.erase(index);
|
|
||||||
pool.free_list.emplace_back(index);
|
pool.free_list.emplace_back(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -256,7 +254,6 @@ namespace zecsy
|
||||||
|
|
||||||
new(&pool.data[index * sizeof(T)]) T(comp);
|
new(&pool.data[index * sizeof(T)]) T(comp);
|
||||||
pool.entity_to_index[e] = index;
|
pool.entity_to_index[e] = index;
|
||||||
pool.index_to_entity[index] = e;
|
|
||||||
|
|
||||||
auto& archetype = entity_to_comps[e];
|
auto& archetype = entity_to_comps[e];
|
||||||
auto old_archetype = archetype;
|
auto old_archetype = archetype;
|
||||||
|
@ -305,7 +302,6 @@ namespace zecsy
|
||||||
auto index = pool.entity_to_index[e];
|
auto index = pool.entity_to_index[e];
|
||||||
pool.free_list.push_back(index);
|
pool.free_list.push_back(index);
|
||||||
pool.entity_to_index.erase(e);
|
pool.entity_to_index.erase(e);
|
||||||
pool.index_to_entity.erase(index);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<Component First, Component Second, Component... Rest>
|
template<Component First, Component Second, Component... Rest>
|
||||||
|
|
Loading…
Reference in a new issue