Skip to content

Code Standards

Identifier Naming

ElementStyleExample
Functions/MethodscamelCaseloadInstalledVersions(), launchGame()
VariablescamelCaseselectedVersion, libPath
ConstantsUPPER_SNAKE_CASEMAX_RETRIES, DEFAULT_TIMEOUT
ClassesPascalCaseLauncherWindow, VersionManager
Folderslowercasesrc/, ui/, core/
Filessnake_caselauncher_window.cpp, version_manager.h

Project Structure

Example of how the code should be organized:

text
src/
├── core/
│   ├── version_manager.h
│   ├── version_manager.cpp
│   ├── pack_installer.h
│   └── pack_installer.cpp

├── ui/
│   ├── windows/
│   │   ├── launcher_window.h
│   │   └── launcher_window.cpp
│   ├── dialogs/
│   │   ├── extract_dialog.h
│   │   └── extract_dialog.cpp

Code Documentation

  • Always document public functions.
  • Use clear comments for complex logic.
  • Follow the existing style in files.

Example:

cpp
/**
 * Loads installed versions from the mcpelauncher directory
 * 
 * @return QStringList with the names of found versions
 */
QStringList loadInstalledVersions();

Released under the BSD-3-Clause License.