axmol icon indicating copy to clipboard operation
axmol copied to clipboard

[Refactor] Improve enum defination rules

Open halx99 opened this issue 3 years ago • 6 comments

When all characters of a enum symbol are uppercase, some times, will confilcit with system macro definations, such as:

  • OS_WINDOWS conflicit with C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\Shlwapi.h
  • ALPHA_MASK confilcit with C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\gdipluspixelformats.h

Sugesstion solution, change all enum to like class name, such as:

ALPHA_MASK to AlphaMask

halx99 avatar Jun 16 '22 14:06 halx99

since it's not exposed to the user, maybe PARTICLE_ALPHA_MASK is better?

DelinWorks avatar Jun 16 '22 14:06 DelinWorks

since it's not exposed to the user, maybe PARTICLE_ALPHA_MASK is better?

May not a good solution, because enum class is suggested for modern c++ programming, add specific prefx looks redundantly

halx99 avatar Jun 16 '22 14:06 halx99

How about defining the EmissionShapeType enum inside ParticleSystem class like these enums:

image

DelinWorks avatar Jun 16 '22 15:06 DelinWorks

I see why now. but AlphaMask feels out of touch

image

DelinWorks avatar Jun 16 '22 15:06 DelinWorks

image

Same goes for point and rect and some others, I think prefixing PARTICLE or SHAPE is good or is it not?

DelinWorks avatar Jun 16 '22 15:06 DelinWorks

I see why now. but AlphaMask feels out of touch

image

It's touch to c# code style.

halx99 avatar Jun 16 '22 23:06 halx99

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 19 '22 11:09 stale[bot]