Alan-FGR/aelum

Decouple Generated Sprite IDs

Alan-FGR opened this issue · 1 comments

Use a custom resolver for sprites you can extend from your game project, currently IDs are generated into the engine assembly, a better solution is to store in a list you can extend from your code, and store the indexes, there are drawbacks though:

  • not stable, removing an item from list breaks serialization (what doesn't happen with enum if you serialize the key as string)
  • no intellisense
  • no free efficient serialization
  • no free compile-time safety check
  • other stuff i don't remember :P

I think there's no way to do this other than an engine-provided dict using string keys that the user adds entries for their sprites, for autocompletion we could generate an enum of strings, we lose safety checks though, and also efficiency since it's not going to be trivial to convert the collection to list and access items by index as opposed to accessing dict by key for the release version.