add IEnum<T>.JoinWith, use it to clean up a bunch of things
This commit is contained in:
@@ -280,7 +280,7 @@ namespace OpenRA
|
||||
|
||||
// Discard any invalid mods
|
||||
var mm = mods.Where( m => Mod.AllMods.ContainsKey( m ) ).ToArray();
|
||||
Console.WriteLine("Loading mods: {0}",string.Join(",",mm));
|
||||
Console.WriteLine("Loading mods: {0}", mm.JoinWith(","));
|
||||
Settings.Game.Mods = mm;
|
||||
Settings.Save();
|
||||
|
||||
|
||||
@@ -102,8 +102,8 @@ namespace OpenRA
|
||||
else if (++index >= t.Count)
|
||||
throw new InvalidOperationException("Trait prerequisites not satisfied (or prerequisite loop) Actor={0} Unresolved={1} Missing={2}".F(
|
||||
Name,
|
||||
string.Join(",", t.Select(x => x.GetType().Name).ToArray()),
|
||||
string.Join(",", unsatisfied.Select(x => x.Name).ToArray())));
|
||||
t.Select(x => x.GetType().Name).JoinWith(","),
|
||||
unsatisfied.Select(x => x.Name).JoinWith(",")));
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA
|
||||
{
|
||||
/* debug crap */
|
||||
Game.Debug("Group #{0}: {1}".F(
|
||||
id, string.Join(",", actors.Select(a => "#{0} {1}".F(a.ActorID, a.Info.Name)).ToArray())));
|
||||
id, actors.Select(a => "#{0} {1}".F(a.ActorID, a.Info.Name)).JoinWith(",")));
|
||||
}
|
||||
|
||||
/* todo: add lazy group path crap, groupleader, pruning, etc */
|
||||
|
||||
@@ -343,7 +343,7 @@ namespace OpenRA
|
||||
if (!OpenRA.Rules.TileSets.ContainsKey(Tileset))
|
||||
throw new InvalidOperationException(
|
||||
"Tileset used by the map ({0}) does not exist in this mod. Valid tilesets are: {1}"
|
||||
.F(Tileset, string.Join(",", OpenRA.Rules.TileSets.Keys.ToArray())));
|
||||
.F(Tileset, OpenRA.Rules.TileSets.Keys.JoinWith(",")));
|
||||
|
||||
// Tile data
|
||||
for (var i = 0; i < MapSize.X; i++)
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Orders
|
||||
if (actorsInvolved.Any())
|
||||
yield return new Order("CreateGroup", actorsInvolved.First().Owner.PlayerActor, false)
|
||||
{
|
||||
TargetString = string.Join(",", actorsInvolved.Select(a => a.ActorID.ToString()).ToArray())
|
||||
TargetString = actorsInvolved.Select(a => a.ActorID).JoinWith(",")
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace OpenRA.Widgets
|
||||
else
|
||||
break;
|
||||
}
|
||||
return string.Join("\n", newLines.ToArray());
|
||||
return newLines.JoinWith("\n");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user