Replace F extension with string interpolation
This commit is contained in:
@@ -50,8 +50,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
Array.Copy(Transforms, 16 * (LimbCount * j + i), testMatrix, 0, 16);
|
||||
if (OpenRA.Graphics.Util.MatrixInverse(testMatrix) == null)
|
||||
throw new InvalidDataException(
|
||||
"The transformation matrix for HVA file `{0}` section {1} frame {2} is invalid because it is not invertible!"
|
||||
.F(fileName, i, j));
|
||||
$"The transformation matrix for HVA file `{fileName}` section {i} frame {j} is invalid because it is not invertible!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{0} - offset 0x{1:x8} - length 0x{2:x8}".F(Filename, Offset, Length);
|
||||
return $"{Filename} - offset 0x{Offset:x8} - length 0x{Length:x8}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
var id = s.ReadASCII(4);
|
||||
|
||||
if (id != "GABA")
|
||||
throw new InvalidDataException("Unable to load Idx file, did not find magic id, found {0} instead".F(id));
|
||||
throw new InvalidDataException($"Unable to load Idx file, did not find magic id, found {id} instead");
|
||||
|
||||
var two = s.ReadInt32();
|
||||
|
||||
if (two != 2)
|
||||
throw new InvalidDataException("Unable to load Idx file, did not find magic number 2, found {0} instead".F(two));
|
||||
throw new InvalidDataException($"Unable to load Idx file, did not find magic number 2, found {two} instead");
|
||||
|
||||
SoundCount = s.ReadInt32();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
static void ReplicatePrevious(byte[] dest, int destIndex, int srcIndex, int count)
|
||||
{
|
||||
if (srcIndex > destIndex)
|
||||
throw new NotImplementedException("srcIndex > destIndex {0} {1}".F(srcIndex, destIndex));
|
||||
throw new NotImplementedException($"srcIndex > destIndex {srcIndex} {destIndex}");
|
||||
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
var count = count3 == 0x3F ? ctx.ReadWord() : count3 + 3;
|
||||
var srcIndex = reverse ? destIndex - ctx.ReadWord() : ctx.ReadWord();
|
||||
if (srcIndex >= destIndex)
|
||||
throw new NotImplementedException("srcIndex >= destIndex {0} {1}".F(srcIndex, destIndex));
|
||||
throw new NotImplementedException($"srcIndex >= destIndex {srcIndex} {destIndex}");
|
||||
|
||||
for (var end = destIndex + count; destIndex < end; destIndex++)
|
||||
dest[destIndex] = dest[srcIndex++];
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
type = stream.ReadASCII(4);
|
||||
}
|
||||
else
|
||||
throw new NotSupportedException("Vqa uses unknown Subtype: {0}".F(type));
|
||||
throw new NotSupportedException($"Vqa uses unknown Subtype: {type}");
|
||||
}
|
||||
|
||||
/*var length = */stream.ReadUInt16();
|
||||
@@ -217,7 +217,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
break;
|
||||
default:
|
||||
if (length + stream.Position > stream.Length)
|
||||
throw new NotSupportedException("Vqa uses unknown Subtype: {0}".F(type));
|
||||
throw new NotSupportedException($"Vqa uses unknown Subtype: {type}");
|
||||
stream.ReadBytes((int)length);
|
||||
break;
|
||||
}
|
||||
@@ -420,7 +420,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
vtprSize = subchunkLength;
|
||||
return;
|
||||
default:
|
||||
throw new InvalidDataException("Unknown sub-chunk {0}".F(type));
|
||||
throw new InvalidDataException($"Unknown sub-chunk {type}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -562,7 +562,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
// Replicate previous
|
||||
var srcIndex = destIndex - rpos;
|
||||
if (srcIndex > destIndex)
|
||||
throw new NotImplementedException("srcIndex > destIndex {0} {1}".F(srcIndex, destIndex));
|
||||
throw new NotImplementedException($"srcIndex > destIndex {srcIndex} {destIndex}");
|
||||
|
||||
for (var j = 0; j < count; j++)
|
||||
{
|
||||
@@ -602,7 +602,7 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
var count = count3 == 0x3F ? ctx.ReadWord() : count3 + 3;
|
||||
var srcIndex = reverse ? destIndex - ctx.ReadWord() : ctx.ReadWord();
|
||||
if (srcIndex >= destIndex)
|
||||
throw new NotImplementedException("srcIndex >= destIndex {0} {1}".F(srcIndex, destIndex));
|
||||
throw new NotImplementedException($"srcIndex >= destIndex {srcIndex} {destIndex}");
|
||||
|
||||
for (var end = destIndex + count; destIndex < end; destIndex++)
|
||||
dest[destIndex] = dest[srcIndex++];
|
||||
|
||||
Reference in New Issue
Block a user