mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 18:29:11 +00:00
Add an enum naming guideline to the GDScript style guide
This partially addresses #1736.
This commit is contained in:
@@ -242,11 +242,24 @@ Use past tense:
|
||||
signal door_opened
|
||||
signal score_changed
|
||||
|
||||
Constants
|
||||
~~~~~~~~~
|
||||
Constants and enums
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Use CONSTANT\_CASE, all caps, with an underscore (\_) to separate words:
|
||||
``const MAX_SPEED = 200``
|
||||
Use CONSTANT\_CASE, all caps, with an underscore (\_) to separate words.
|
||||
|
||||
Enum *names* (if any) should use PascalCase, but their *values* should be in
|
||||
CONSTANT\_CASE.
|
||||
|
||||
::
|
||||
|
||||
const MAX_SPEED = 200
|
||||
|
||||
enum Element {
|
||||
EARTH,
|
||||
WATER,
|
||||
AIR,
|
||||
FIRE,
|
||||
}
|
||||
|
||||
Static typing
|
||||
-------------
|
||||
|
||||
Reference in New Issue
Block a user