|
5 | 5 | ### Naming Conventions |
6 | 6 |
|
7 | 7 | - Use `camelCase` for local variables, `SNAKE_CASE` for preprocessor macros, and `PascalCase` for everything else. Marathon-specific types that don't exist in the game should use `snake_case` for better differentiation. |
8 | | -- Class names should be prefixed with `C`, e.g., `CSonicContext`. |
9 | | -- Struct names should be prefixed with `S`, e.g., `SUpdateInfo`. |
10 | 8 | - Class members should be prefixed with `m_`, e.g., `m_Time`. Do not use this prefix for struct members. |
11 | | -- Enum names should be prefixed with `E`, e.g., `ELightType`. |
12 | | -- Enum members should start with `e`, followed by the enum name and an underscore, e.g., `eLightType_Point`. |
13 | | -- For enum members indicating the count of elements, prefix with `n`, followed by the name, e.g., `nLightType`. |
14 | 9 | - Pointers should be prefixed with `p`, e.g., `pSonicContext`. |
15 | 10 | - Shared pointers should be prefixed with `sp`, e.g., `spDatabase`. |
16 | 11 | - References should be prefixed with `r`, e.g., `rMessage`. |
17 | | -- Input function arguments should be prefixed with `in_`, e.g., `in_Name`. |
18 | | -- Output function arguments should be prefixed with `out_`, e.g., `out_Value`. |
19 | | -- Static class members should be prefixed with `ms_`, e.g., `ms_Instance`. |
20 | 12 | - Static members outside a class should be prefixed with `g_`, e.g., `g_AllocationTracker`. |
21 | 13 | - Marathon-specific preprocessor macros should start with `MARATHON_`, e.g., `MARATHON_INSERT_PADDING`. |
22 | | -- Hedgehog namespace-specific preprocessor macros should start with `HH_` along with the library's shorthand, e.g., `HH_FND_MSG_MAKE_TYPE`. |
23 | 14 | - Function pointers should be prefixed with `fp`, e.g., `fpCGameObjectConstructor`. |
24 | 15 |
|
25 | | -Combine prefixes as necessary, e.g., `m_sp` for a shared pointer as a class member or `in_r` for a const reference as a function argument. |
| 16 | +Combine prefixes as necessary, e.g., `m_sp` for a shared pointer as a class member. |
26 | 17 |
|
27 | 18 | ### Coding Style |
28 | 19 |
|
|
0 commit comments