Skip to content

Conversation

@josephcsible
Copy link
Contributor

No description provided.

int paintwhat = 0;
int paintwhat_alt_wall = 0;
int painttype = 0;
enum class ePainttype { monsters, items, lands, walls, copy, boundary, paint, select, teleport };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I always prefer to see enums with explicit sizes (underlying types). Makes it clearer how big they are, which is never harmful to know and can sometimes be helpful (struct layout). So I'd make this

enum class ePainttype : int {

or even

enum class ePainttype : unsigned char {

(not that it matters in this particular case AFAICT at first glance).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with that, but I don't think it's Zeno's style, since there are dozens of enums in HyperRogue already, of which only three (eModel, ptype, and ePattern) specify an underlying type.

@zenorogue zenorogue merged commit 4000f1f into zenorogue:master Oct 19, 2025
12 checks passed
@zenorogue
Copy link
Owner

Yes, I am treating non-typed enums like "int" (maybe some other type would be enough but there is not much point to care in this particular situation). I think there are some other cases where something should be an enum but is an int for historical/laziness reasons.

@josephcsible josephcsible deleted the ePainttype branch October 19, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants