Coder Social home page Coder Social logo

Comments (2)

pgruenbacher avatar pgruenbacher commented on June 13, 2024 1

yea I agree ASSERT is the best option for now.
i think entt::storage<ENTT_ID_TYPE> / entt::storage<uint32_t> still works just fine anyways it just means there's lots of casting.
or yea boxed types works too

from entt.

skypjack avatar skypjack commented on June 13, 2024

I think that asserting is the right thing to do here. In fact, there is a problem with this:

or allow for custom entt::entity_type storage so that users can have various id<->id sets

Entity storage works differently. It's meant to generate entities and recycle them. It never destroys its elements. Instead, it moves them around and increases their versions.
An entt::storage<entt::entity> isn't an id-to-id mapping. Quite the opposite actually. It picks a storage specialization with a completely different goal.
You can still have id-to-id mappings but you've to use boxed types for that. This is the drawback of managing the entities with a storage type. I think it's worth it because of all the pros but 🤷‍♂️ you know, all solutions have their pros and cons at the end of the day.

So, yeah, I think I'll add an assert to avoid errors and that's it. Let me know your thougts too. 👍

from entt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.