snapshot: constness review

This commit is contained in:
Michele Caini
2023-05-02 14:30:20 +02:00
parent 885488b3d6
commit 912cb2ad54

View File

@@ -160,7 +160,7 @@ class basic_snapshot_loader {
using traits_type = typename Registry::traits_type;
template<typename Component, typename Archive>
void assign(Archive &archive) const {
void assign(Archive &archive) {
auto &storage = reg->template storage<entity_type>();
auto &elem = reg->template storage<Component>();
@@ -221,7 +221,7 @@ public:
* @return A valid loader to continue restoring data.
*/
template<typename Archive>
const basic_snapshot_loader &entities(Archive &archive) const {
basic_snapshot_loader &entities(Archive &archive) {
auto &storage = reg->template storage<entity_type>();
typename traits_type::entity_type length{};
typename traits_type::entity_type in_use{};
@@ -256,7 +256,7 @@ public:
* @return A valid loader to continue restoring data.
*/
template<typename... Component, typename Archive>
const basic_snapshot_loader &component(Archive &archive) const {
basic_snapshot_loader &component(Archive &archive) {
(assign<Component>(archive), ...);
return *this;
}
@@ -271,7 +271,7 @@ public:
*
* @return A valid loader to continue restoring data.
*/
const basic_snapshot_loader &orphans() const {
basic_snapshot_loader &orphans() {
auto &storage = reg->template storage<entity_type>();
for(auto entt: storage) {