Use modern string syntax.

This commit is contained in:
Matthias Mailänder
2022-02-23 10:44:01 +01:00
committed by abcdefg30
parent 57d3321d0f
commit da4fb27fca
3 changed files with 9 additions and 9 deletions

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
{
var fields = section.Value.GetType().GetFields();
if (fields.Length > 0 && fields.Where(field => field.GetCustomAttributes<DescAttribute>(false).Length > 0).Count() > 0)
Console.WriteLine("## {0}", section.Key);
Console.WriteLine($"## {section.Key}");
else
Console.WriteLine();
@@ -69,11 +69,11 @@ namespace OpenRA.Mods.Common.UtilityCommands
if (!field.HasAttribute<DescAttribute>())
continue;
Console.WriteLine("### {0}", field.Name);
Console.WriteLine($"### {field.Name}");
var lines = field.GetCustomAttributes<DescAttribute>(false).SelectMany(d => d.Lines);
foreach (var line in lines)
{
Console.WriteLine("{0}", line);
Console.WriteLine(line);
Console.WriteLine();
}
@@ -83,8 +83,8 @@ namespace OpenRA.Mods.Common.UtilityCommands
Console.WriteLine("**Default Value:** {0}", value);
Console.WriteLine();
Console.WriteLine("```yaml");
Console.WriteLine("{0}: ", section.Key);
Console.WriteLine("\t{0}: {1}", field.Name, value);
Console.WriteLine($"{section.Key}: ");
Console.WriteLine($"\t{field.Name}: {value}");
Console.WriteLine("```");
}
else

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2021 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2022 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
Console.WriteLine(
"This documentation is aimed at modders. It displays all traits with default values and developer commentary. " +
"Please do not edit it directly, but add new `[Desc(\"String\")]` tags to the source code. This file has been " +
"automatically generated for version {0} of OpenRA.", version);
$"automatically generated for version {version} of OpenRA.");
Console.WriteLine();
var doc = new StringBuilder();

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2021 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2022 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
"This documentation is aimed at modders. It displays a template for weapon definitions " +
"as well as its contained types (warheads and projectiles) with default values and developer commentary. " +
"Please do not edit it directly, but add new `[Desc(\"String\")]` tags to the source code. This file has been " +
"automatically generated for version {0} of OpenRA.", version);
$"automatically generated for version {version} of OpenRA.");
Console.WriteLine();
var doc = new StringBuilder();