Fix RCS1112
This commit is contained in:
@@ -1016,6 +1016,9 @@ dotnet_diagnostic.RCS1107.severity = warning
|
|||||||
# Add 'static' modifier to all partial class declarations.
|
# Add 'static' modifier to all partial class declarations.
|
||||||
dotnet_diagnostic.RCS1108.severity = warning
|
dotnet_diagnostic.RCS1108.severity = warning
|
||||||
|
|
||||||
|
# Combine 'Enumerable.Where' method chain.
|
||||||
|
dotnet_diagnostic.RCS1112.severity = warning
|
||||||
|
|
||||||
# Use 'string.IsNullOrEmpty' method.
|
# Use 'string.IsNullOrEmpty' method.
|
||||||
dotnet_diagnostic.RCS1113.severity = warning
|
dotnet_diagnostic.RCS1113.severity = warning
|
||||||
|
|
||||||
|
|||||||
@@ -76,16 +76,18 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
{
|
{
|
||||||
// Per-actor production
|
// Per-actor production
|
||||||
queues = self.TraitsImplementing<ProductionQueue>()
|
queues = self.TraitsImplementing<ProductionQueue>()
|
||||||
.Where(q => productionInfos.Any(p => p.Produces.Contains(q.Info.Type)))
|
.Where(q =>
|
||||||
.Where(q => Info.Queues.Count == 0 || Info.Queues.Contains(q.Info.Type))
|
productionInfos.Any(p => p.Produces.Contains(q.Info.Type)) &&
|
||||||
|
(Info.Queues.Count == 0 || Info.Queues.Contains(q.Info.Type)))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
if (queues.Length == 0)
|
if (queues.Length == 0)
|
||||||
{
|
{
|
||||||
// Player-wide production
|
// Player-wide production
|
||||||
queues = self.Owner.PlayerActor.TraitsImplementing<ProductionQueue>()
|
queues = self.Owner.PlayerActor.TraitsImplementing<ProductionQueue>()
|
||||||
.Where(q => productionInfos.Any(p => p.Produces.Contains(q.Info.Type)))
|
.Where(q =>
|
||||||
.Where(q => Info.Queues.Count == 0 || Info.Queues.Contains(q.Info.Type))
|
productionInfos.Any(p => p.Produces.Contains(q.Info.Type)) &&
|
||||||
|
(Info.Queues.Count == 0 || Info.Queues.Contains(q.Info.Type)))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -323,11 +323,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
playerCountFilter = -1;
|
playerCountFilter = -1;
|
||||||
|
|
||||||
var maps = tabMaps[tab]
|
var maps = tabMaps[tab]
|
||||||
.Where(m => category == null || m.Categories.Contains(category))
|
.Where(m => (category == null || m.Categories.Contains(category)) &&
|
||||||
.Where(m => mapFilter == null ||
|
(mapFilter == null ||
|
||||||
(m.Title != null && m.Title.Contains(mapFilter, StringComparison.CurrentCultureIgnoreCase)) ||
|
(m.Title != null && m.Title.Contains(mapFilter, StringComparison.CurrentCultureIgnoreCase)) ||
|
||||||
(m.Author != null && m.Author.Contains(mapFilter, StringComparison.CurrentCultureIgnoreCase)) ||
|
(m.Author != null && m.Author.Contains(mapFilter, StringComparison.CurrentCultureIgnoreCase)) ||
|
||||||
m.PlayerCount == playerCountFilter);
|
m.PlayerCount == playerCountFilter));
|
||||||
|
|
||||||
if (orderByFunc == null)
|
if (orderByFunc == null)
|
||||||
maps = maps.OrderBy(m => m.Title);
|
maps = maps.OrderBy(m => m.Title);
|
||||||
|
|||||||
Reference in New Issue
Block a user