58 lines
1.4 KiB
Markdown
58 lines
1.4 KiB
Markdown
# Comment Formatting Standards
|
|
|
|
## Line Width
|
|
|
|
Wrap comments at approximately 60 columns. Code and function signatures are not wrapped.
|
|
|
|
## Comment Style
|
|
|
|
Use C++ style (`//`) for all comments. Use `/** */` only for UENUM/UPROPERTY values that should appear as tooltips in the blueprint editor.
|
|
|
|
## Section Banners
|
|
|
|
Each class, struct, or enum gets a banner block. The banner line is 60 characters of slashes. The banner names the type and gives a brief description.
|
|
|
|
```cpp
|
|
////////////////////////////////////////////////////////////
|
|
//
|
|
// FlxExampleClass
|
|
//
|
|
// Brief description of what this class does.
|
|
//
|
|
////////////////////////////////////////////////////////////
|
|
```
|
|
|
|
## Header File Banners
|
|
|
|
Ideally, we'd like to have documentation about what a header
|
|
file is for. This would be a banner block at the top of the
|
|
header file, before the pragma once. If you're claude code,
|
|
and there is no documentation yet, generate a little, but
|
|
mark it "DOCUMENTATION GENERATED BY CLAUDE."
|
|
|
|
## Member Comments
|
|
|
|
Comments on member variables and functions use `//` followed by a blank `//` line:
|
|
|
|
```cpp
|
|
// Brief description of what this does.
|
|
//
|
|
void DoSomething();
|
|
```
|
|
|
|
## UFUNCTION Spacing
|
|
|
|
UFUNCTION-decorated members should be followed by a single blank line to visually separate them from the next member:
|
|
|
|
```cpp
|
|
// Get the value.
|
|
//
|
|
UFUNCTION(BlueprintCallable)
|
|
int32 GetValue() const;
|
|
|
|
// Set the value.
|
|
//
|
|
UFUNCTION(BlueprintCallable)
|
|
void SetValue(int32 Val);
|
|
```
|