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

@@ -53,7 +53,7 @@ namespace OpenRA
ResourcesOffset = s.ReadUInt32();
}
else
throw new InvalidDataException("Unknown binary map format '{0}'".F(Format));
throw new InvalidDataException($"Unknown binary map format '{Format}'");
}
}
@@ -100,7 +100,7 @@ namespace OpenRA
if (node == null)
{
if (required)
throw new YamlException("Required field `{0}` not found in map.yaml".F(key));
throw new YamlException($"Required field `{key}` not found in map.yaml");
return;
}
@@ -258,7 +258,7 @@ namespace OpenRA
var contents = package.Contents.ToList();
foreach (var required in requiredFiles)
if (!contents.Contains(required))
throw new FileNotFoundException("Required file {0} not present in this map".F(required));
throw new FileNotFoundException($"Required file {required} not present in this map");
var streams = new List<Stream>();
try
@@ -326,18 +326,18 @@ namespace OpenRA
Package = package;
if (!Package.Contains("map.yaml") || !Package.Contains("map.bin"))
throw new InvalidDataException("Not a valid map\n File: {0}".F(package.Name));
throw new InvalidDataException($"Not a valid map\n File: {package.Name}");
var yaml = new MiniYaml(null, MiniYaml.FromStream(Package.GetStream("map.yaml"), package.Name));
foreach (var field in YamlFields)
field.Deserialize(this, yaml.Nodes);
if (MapFormat != SupportedMapFormat)
throw new InvalidDataException("Map format {0} is not supported.\n File: {1}".F(MapFormat, package.Name));
throw new InvalidDataException($"Map format {MapFormat} is not supported.\n File: {package.Name}");
PlayerDefinitions = MiniYaml.NodesOrEmpty(yaml, "Players");
if (PlayerDefinitions.Count > 64)
throw new InvalidDataException("Maps must not define more than 64 players.\n File: {0}".F(package.Name));
throw new InvalidDataException($"Maps must not define more than 64 players.\n File: {package.Name}");
ActorDefinitions = MiniYaml.NodesOrEmpty(yaml, "Actors");
@@ -1251,7 +1251,7 @@ namespace OpenRA
if (maxRange >= Grid.TilesByDistance.Length)
throw new ArgumentOutOfRangeException(nameof(maxRange),
"The requested range ({0}) cannot exceed the value of MaximumTileSearchRange ({1})".F(maxRange, Grid.MaximumTileSearchRange));
$"The requested range ({maxRange}) cannot exceed the value of MaximumTileSearchRange ({Grid.MaximumTileSearchRange})");
for (var i = minRange; i <= maxRange; i++)
{