You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the IDs of any sort are uints in QCX. Sadly this type does cover multiple use cases:
Instance IDs: Entities on the server (mobs, players, npcs) all have their unique ID which identifies them on the server (this ID does not persist)
Database IDs: Some entities are tracked in the database (i.e. players). They obviously have a unique key (primary key)
It's not clear which use case the type uint represents in each case. Mistakes can be made easily. To prevent this we can implement custom ID types which are still uints but you have to explicitly cast them to change one to another - making transitions very clear - if ever needed.
The text was updated successfully, but these errors were encountered:
see https://andrewlock.net/using-strongly-typed-entity-ids-to-avoid-primitive-obsession-part-1/
Most of the IDs of any sort are
uint
s in QCX. Sadly this type does cover multiple use cases:It's not clear which use case the type
uint
represents in each case. Mistakes can be made easily. To prevent this we can implement custom ID types which are stilluint
s but you have to explicitly cast them to change one to another - making transitions very clear - if ever needed.The text was updated successfully, but these errors were encountered: