Replace F extension with string interpolation
This commit is contained in:
@@ -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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}}}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user