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

@@ -81,7 +81,7 @@ namespace OpenRA
static void CheckDestroyed(Actor actor)
{
if (actor.Disposed)
throw new InvalidOperationException("Attempted to get trait from destroyed object ({0})".F(actor));
throw new InvalidOperationException($"Attempted to get trait from destroyed object ({actor})");
}
public T Get<T>(Actor actor)
@@ -160,7 +160,7 @@ namespace OpenRA
{
var result = GetOrDefault(actor);
if (result == null)
throw new InvalidOperationException("Actor {0} does not have trait of type `{1}`".F(actor.Info.Name, typeof(T)));
throw new InvalidOperationException($"Actor {actor.Info.Name} does not have trait of type `{typeof(T)}`");
return result;
}
@@ -173,7 +173,7 @@ namespace OpenRA
return default;
if (index + 1 < actors.Count && actors[index + 1] == actor)
throw new InvalidOperationException("Actor {0} has multiple traits of type `{1}`".F(actor.Info.Name, typeof(T)));
throw new InvalidOperationException($"Actor {actor.Info.Name} has multiple traits of type `{typeof(T)}`");
return traits[index];
}