Use modern string syntax.
This commit is contained in:
committed by
abcdefg30
parent
57d3321d0f
commit
da4fb27fca
@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
{
|
{
|
||||||
var fields = section.Value.GetType().GetFields();
|
var fields = section.Value.GetType().GetFields();
|
||||||
if (fields.Length > 0 && fields.Where(field => field.GetCustomAttributes<DescAttribute>(false).Length > 0).Count() > 0)
|
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
|
else
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
|
|
||||||
@@ -69,11 +69,11 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
if (!field.HasAttribute<DescAttribute>())
|
if (!field.HasAttribute<DescAttribute>())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Console.WriteLine("### {0}", field.Name);
|
Console.WriteLine($"### {field.Name}");
|
||||||
var lines = field.GetCustomAttributes<DescAttribute>(false).SelectMany(d => d.Lines);
|
var lines = field.GetCustomAttributes<DescAttribute>(false).SelectMany(d => d.Lines);
|
||||||
foreach (var line in lines)
|
foreach (var line in lines)
|
||||||
{
|
{
|
||||||
Console.WriteLine("{0}", line);
|
Console.WriteLine(line);
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,8 +83,8 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
Console.WriteLine("**Default Value:** {0}", value);
|
Console.WriteLine("**Default Value:** {0}", value);
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
Console.WriteLine("```yaml");
|
Console.WriteLine("```yaml");
|
||||||
Console.WriteLine("{0}: ", section.Key);
|
Console.WriteLine($"{section.Key}: ");
|
||||||
Console.WriteLine("\t{0}: {1}", field.Name, value);
|
Console.WriteLine($"\t{field.Name}: {value}");
|
||||||
Console.WriteLine("```");
|
Console.WriteLine("```");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#region Copyright & License Information
|
#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
|
* 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
|
* available to you under the terms of the GNU General Public License
|
||||||
* as published by the Free Software Foundation, either version 3 of
|
* as published by the Free Software Foundation, either version 3 of
|
||||||
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
Console.WriteLine(
|
Console.WriteLine(
|
||||||
"This documentation is aimed at modders. It displays all traits with default values and developer commentary. " +
|
"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 " +
|
"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();
|
Console.WriteLine();
|
||||||
|
|
||||||
var doc = new StringBuilder();
|
var doc = new StringBuilder();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#region Copyright & License Information
|
#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
|
* 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
|
* available to you under the terms of the GNU General Public License
|
||||||
* as published by the Free Software Foundation, either version 3 of
|
* 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 " +
|
"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. " +
|
"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 " +
|
"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();
|
Console.WriteLine();
|
||||||
|
|
||||||
var doc = new StringBuilder();
|
var doc = new StringBuilder();
|
||||||
|
|||||||
Reference in New Issue
Block a user