Skip to content

Code Style Document

Valk edited this page Oct 12, 2024 · 32 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.

Principles

Please familiarize yourself with these principles.

General Guidelines

Formatting

  • Indentation: 4 spaces.
  • Curly Braces: Always expand.
  • Using Directives: Above namespace.

Naming

  • PascalCase: Types, methods, properties, constants, events.
  • camelCase: Private fields, local variables, method args.
  • Prefixes: On for events, Set for set methods, Get for get methods

Language Features

  • Static Functions: Use when possible.
  • CallDeferred(): Avoid if alternatives exist.
  • var Keyword: Never use.
  • C# Delegate Events: Always use over Godot signals.
  • Explicit Private Modifiers: Always specify private.
Clone this wiki locally