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

@@ -126,7 +126,7 @@ namespace OpenRA.Primitives
public override string ToString()
{
return "{0},{1},{2},{3}".F(X, Y, Width, Height);
return $"{X},{Y},{Width},{Height}";
}
}
}

View File

@@ -66,7 +66,7 @@ namespace OpenRA.Primitives
public override string ToString()
{
return string.Format("{{Width={0}, Height={1}}}", Width, Height);
return $"{{Width={Width}, Height={Height}}}";
}
}
}

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Primitives
void ValidateBounds(T actor, Rectangle bounds)
{
if (bounds.Width == 0 || bounds.Height == 0)
throw new ArgumentException("Bounds of actor {0} are empty.".F(actor), nameof(bounds));
throw new ArgumentException($"Bounds of actor {actor} are empty.", nameof(bounds));
}
public void Add(T item, Rectangle bounds)

View File

@@ -64,12 +64,12 @@ namespace OpenRA.Primitives
if (!data.TryGetValue(t, out var ret))
{
if (throwsIfMissing)
throw new InvalidOperationException("TypeDictionary does not contain instance of type `{0}`".F(t));
throw new InvalidOperationException($"TypeDictionary does not contain instance of type `{t}`");
return null;
}
if (ret.Count > 1)
throw new InvalidOperationException("TypeDictionary contains multiple instances of type `{0}`".F(t));
throw new InvalidOperationException($"TypeDictionary contains multiple instances of type `{t}`");
return ret[0];
}

View File

@@ -58,7 +58,7 @@ namespace OpenRA
return obj is float3 o && (float3?)o == this;
}
public override string ToString() { return "{0},{1},{2}".F(X, Y, Z); }
public override string ToString() { return $"{X},{Y},{Z}"; }
public static readonly float3 Zero = new float3(0, 0, 0);
public static readonly float3 Ones = new float3(1, 1, 1);