hohav / peppi

Rust parser for Slippi SSBM replay files
MIT License
37 stars 9 forks source link

Expand macro rules to allow colloquial names #8

Closed NickCondron closed 2 years ago

NickCondron commented 2 years ago

Simple PR to expand the psuedo_enum macro to allow for colloquial/short names for characters/stages/etc. I think it makes sense to have this feature in peppi so library users (like myself) don't have to reimplement this sort of functionality for any client-facing input. Discussion points:

hohav commented 2 years ago

Thanks for the PR. Could you describe the use case you have in mind? I'm guessing it's for allowing users to type the name of a stage, character, etc?

I added named constants primarily for programmer ergonomics, not really for display purposes. I'm not opposed to including this info in peppi, I just don't think it belongs with these constants.

I need to give it more thought, but my first instinct is we'd want structs to hold info such as display names, alternative names, and maybe other info such as blast zone size etc. The constants still need to exist so that we can parse SLP files, and we'd have maybe a hash map from constants to their info structs.

NickCondron commented 2 years ago

Yes the intent is to help support user-friendly naming. User-friendly display is separate but they could be tied together as part of the same structure.

I agree there's betters ways of doing this. I'll just close this and try a different approach when I get back home.