-
Notifications
You must be signed in to change notification settings - Fork 10
Code Style Document
Valk edited this page Jul 29, 2025
·
65 revisions
If the following looks overwhelming to you, you can ignore it, I will try my best to refactor your PRs to conform to these standards.
- Indentation: 4 spaces.
- Line Endings: LF.
- Curly Braces: Always expand unless the expression(s) / statement(s) are short.
- Using Directives: Above namespace.
- PascalCase: Types, methods, properties, constants, events.
- camelCase: Private fields, local variables, method args.
- Private fields: Always prefix with an underscore.
-
Events: Avoid prefixing events with
On
as subscribers should use this instead.
- var Keyword: Never use unless the type is absurdly long.
- C# Events: Always use over Godot signals.
-
Explicit Private Modifiers: Always specify
private
. - File Scoped Namespaces: Always use.
- Public Functions: Avoid if possible.
- Private Functions: Use when possible.
-
Events: Never use unless you set them to
null
on tree exit.
- Godot Exports
- Events
- Public Properties
- Public Fields
- Private Properties
- Private Fields
- Godot Overrides
- Public Functions
- Private Functions
- Private Static Functions
Please familiarize yourself with these principles.