🌎
Xeus
StoriesTechnicalsMechanicsEnglish
  • 👋Добро пожаловать в Xeus!
  • Mechanics
    • Melee weapon
    • Modular Weapons
    • Armor system
    • Tech evolution
      • PVE-Ветка
      • MID-Ветка
      • PVP-Ветка
      • ADD-Ветка
    • Sense system
    • Artificial intelligence
  • Technical
    • Design Document
      • Character State
      • Game world
      • Equipment
      • Building
      • Alchemy and craft
      • Gameplay experience
    • Code style
      • Comments
      • Basic
      • Definitions
      • UE Difference
  • Alexander's stories
    • Robot
    • Alchemiest and his tools
    • Flint
Powered by GitBook
On this page
  1. Technical
  2. Code style

Basic

Базовые конструкции С++ и их стиль

Basic constructions

  • Фигурные скобки с новой строчки

  • Пробелы между ключевыми словами и скобками

  • Разделение блоками кода

{
    // some code
}
{
    // another code
}
if (condition)
{
    // code here
}
else if (another_condition)
{
    // code here
}
else 
{
    // code here
}
for (int32 i = 0; i < n; ++i)
{
    // code here
}
for (FVector& var : Vertices)
{
    // code here
}
while (condition)
{
    // code here
}
switch (GenerationType)
{
	case EMeshGenerationType::Delay:
		StartDelaySpawn(server);
		break;
	case EMeshGenerationType::Instant_Both:
		StartInstantSpawn(server);
		break;
	case EMeshGenerationType::Instant_ServerOnly:
	{
		// code here
		break;
	}
	default:
		StartDelaySpawn(server);
		break;
}
PreviousCommentsNextDefinitions

Last updated 1 year ago