Replace F extension with string interpolation

This commit is contained in:
teinarss
2021-04-24 17:46:24 +02:00
committed by reaperrr
parent 1385aca783
commit 10676be377
300 changed files with 752 additions and 799 deletions

View File

@@ -38,8 +38,7 @@ namespace OpenRA.Mods.Cnc.Graphics
if (useClassicFacings && Facings != 32)
throw new InvalidOperationException(
"{0}: Sequence {1}.{2}: UseClassicFacings is only valid for 32 facings"
.F(info.Nodes[0].Location, sequence, animation));
$"{info.Nodes[0].Location}: Sequence {sequence}.{animation}: UseClassicFacings is only valid for 32 facings");
}
protected override int GetFacingFrameOffset(WAngle facing)

View File

@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Cnc.Graphics
public Voxel(VoxelLoader loader, VxlReader vxl, HvaReader hva, (string Vxl, string Hva) files)
{
if (vxl.LimbCount != hva.LimbCount)
throw new InvalidOperationException("{0}.vxl and {1}.hva limb counts don't match.".F(files.Vxl, files.Hva));
throw new InvalidOperationException($"{files.Vxl}.vxl and {files.Hva}.hva limb counts don't match.");
transforms = hva.Transforms;
frames = hva.FrameCount;
@@ -60,9 +60,9 @@ namespace OpenRA.Mods.Cnc.Graphics
public float[] TransformationMatrix(uint limb, uint frame)
{
if (frame >= frames)
throw new ArgumentOutOfRangeException(nameof(frame), "Only {0} frames exist.".F(frames));
throw new ArgumentOutOfRangeException(nameof(frame), $"Only {frames} frames exist.");
if (limb >= limbs)
throw new ArgumentOutOfRangeException(nameof(limb), "Only {1} limbs exist.".F(limbs));
throw new ArgumentOutOfRangeException(nameof(limb), $"Only {limbs} limbs exist.");
var l = limbData[limb];
var t = new float[16];

View File

@@ -98,10 +98,10 @@ namespace OpenRA.Mods.Cnc.Graphics
{
if (models.ContainsKey(model))
throw new InvalidOperationException(
"Model `{0}` does not have a sequence `{1}`".F(model, sequence));
$"Model `{model}` does not have a sequence `{sequence}`");
else
throw new InvalidOperationException(
"Model `{0}` does not have any sequences defined.".F(model));
$"Model `{model}` does not have any sequences defined.");
}
}
@@ -109,7 +109,7 @@ namespace OpenRA.Mods.Cnc.Graphics
{
if (!models.ContainsKey(model))
throw new InvalidOperationException(
"Model `{0}` does not have any sequences defined.".F(model));
$"Model `{model}` does not have any sequences defined.");
return models[model].ContainsKey(sequence);
}