RCS0056 - roslynator_max_line_length = 180

This commit is contained in:
RoosterDragon
2024-01-13 20:59:33 +00:00
committed by Matthias Mailänder
parent 822a29aa76
commit 9d5d2ab493
66 changed files with 338 additions and 97 deletions

View File

@@ -58,13 +58,16 @@ namespace OpenRA.Graphics
var tintModifiers = CurrentSequence.IgnoreWorldTint ? TintModifiers.IgnoreWorldTint : TintModifiers.None;
var alpha = CurrentSequence.GetAlpha(CurrentFrame);
var (image, rotation) = CurrentSequence.GetSpriteWithRotation(CurrentFrame, facingFunc());
var imageRenderable = new SpriteRenderable(image, pos, offset, CurrentSequence.ZOffset + zOffset, palette, CurrentSequence.Scale, alpha, float3.Ones, tintModifiers, IsDecoration,
rotation);
var imageRenderable = new SpriteRenderable(
image, pos, offset, CurrentSequence.ZOffset + zOffset, palette,
CurrentSequence.Scale, alpha, float3.Ones, tintModifiers, IsDecoration, rotation);
var shadow = CurrentSequence.GetShadow(CurrentFrame, facingFunc());
if (shadow != null)
{
var shadowRenderable = new SpriteRenderable(shadow, pos, offset, CurrentSequence.ShadowZOffset + zOffset, palette, CurrentSequence.Scale, 1f, float3.Ones, tintModifiers,
var shadowRenderable = new SpriteRenderable(
shadow, pos, offset, CurrentSequence.ShadowZOffset + zOffset, palette,
CurrentSequence.Scale, 1f, float3.Ones, tintModifiers,
true, rotation);
return new IRenderable[] { shadowRenderable, imageRenderable };
}

View File

@@ -216,7 +216,8 @@ namespace OpenRA.Graphics
parent.DrawRGBAQuad(vertices, blendMode);
}
public void FillRect(in float3 a, in float3 b, in float3 c, in float3 d, Color topLeftColor, Color topRightColor, Color bottomRightColor, Color bottomLeftColor, BlendMode blendMode = BlendMode.Alpha)
public void FillRect(in float3 a, in float3 b, in float3 c, in float3 d,
Color topLeftColor, Color topRightColor, Color bottomRightColor, Color bottomLeftColor, BlendMode blendMode = BlendMode.Alpha)
{
vertices[0] = VertexWithColor(a + Offset, topLeftColor);
vertices[1] = VertexWithColor(b + Offset, topRightColor);

View File

@@ -45,7 +45,8 @@ namespace OpenRA.Graphics
this.loaders = loaders;
}
public int ReserveSprites(string filename, IEnumerable<int> frames, MiniYamlNode.SourceLocation location, Func<ISpriteFrame, ISpriteFrame> adjustFrame = null, bool premultiplied = false)
public int ReserveSprites(string filename, IEnumerable<int> frames, MiniYamlNode.SourceLocation location,
Func<ISpriteFrame, ISpriteFrame> adjustFrame = null, bool premultiplied = false)
{
var token = nextReservationToken++;
spriteReservations[token] = (frames?.ToArray(), location, adjustFrame, premultiplied);

View File

@@ -410,10 +410,16 @@ namespace OpenRA
{
UpdateMaps();
var map = string.IsNullOrEmpty(initialUid) ? null : previews[initialUid];
if (map == null || map.Status != MapStatus.Available || !map.Visibility.HasFlag(MapVisibility.Lobby) || (map.Class != MapClassification.System && map.Class != MapClassification.User))
if (map == null ||
map.Status != MapStatus.Available ||
!map.Visibility.HasFlag(MapVisibility.Lobby) ||
(map.Class != MapClassification.System && map.Class != MapClassification.User))
{
var selected = previews.Values.Where(IsSuitableInitialMap).RandomOrDefault(random) ??
previews.Values.FirstOrDefault(m => m.Status == MapStatus.Available && m.Visibility.HasFlag(MapVisibility.Lobby) && (m.Class == MapClassification.System || m.Class == MapClassification.User));
previews.Values.FirstOrDefault(m =>
m.Status == MapStatus.Available &&
m.Visibility.HasFlag(MapVisibility.Lobby) &&
(m.Class == MapClassification.System || m.Class == MapClassification.User));
return selected == null ? string.Empty : selected.Uid;
}

View File

@@ -339,7 +339,8 @@ namespace OpenRA
}, null);
}
public void UpdateFromMap(IReadOnlyPackage p, IReadOnlyPackage parent, MapClassification classification, string[] mapCompatibility, MapGridType gridType, IEnumerable<List<MiniYamlNode>> modDataRules)
public void UpdateFromMap(IReadOnlyPackage p, IReadOnlyPackage parent, MapClassification classification,
string[] mapCompatibility, MapGridType gridType, IEnumerable<List<MiniYamlNode>> modDataRules)
{
Dictionary<string, MiniYaml> yaml;
using (var yamlStream = p.GetStream("map.yaml"))

View File

@@ -463,7 +463,8 @@ namespace OpenRA
}
catch (ArgumentException)
{
throw new YamlException($"{n.Location}: Parent type `{n.Value.Value}` was already inherited by this yaml tree at {inherited[n.Value.Value]} (note: may be from a derived tree)");
throw new YamlException(
$"{n.Location}: Parent type `{n.Value.Value}` was already inherited by this yaml tree at {inherited[n.Value.Value]} (note: may be from a derived tree)");
}
foreach (var r in ResolveInherits(parent, tree, inherited))

View File

@@ -78,7 +78,8 @@ namespace OpenRA
readonly Target target;
readonly Target visualFeedbackTarget;
Order(string orderString, Actor subject, in Target target, string targetString, bool queued, Actor[] extraActors, CPos extraLocation, uint extraData, Actor[] groupedActors = null)
Order(string orderString, Actor subject, in Target target, string targetString, bool queued,
Actor[] extraActors, CPos extraLocation, uint extraData, Actor[] groupedActors = null)
{
OrderString = orderString ?? "";
Subject = subject;

View File

@@ -337,7 +337,8 @@ namespace OpenRA
// Render the compositor buffers to the screen
// HACK / PERF: Fudge the coordinates to cover the actual window while keeping the buffer viewport parameters
// This saves us two redundant (and expensive) SetViewportParams each frame
RgbaSpriteRenderer.DrawSprite(screenSprite, new float3(0, lastBufferSize.Height, 0), new float3(lastBufferSize.Width / screenSprite.Size.X, -lastBufferSize.Height / screenSprite.Size.Y, 1f));
RgbaSpriteRenderer.DrawSprite(screenSprite, new float3(0, lastBufferSize.Height, 0),
new float3(lastBufferSize.Width / screenSprite.Size.X, -lastBufferSize.Height / screenSprite.Size.Y, 1f));
Flush();
Window.PumpInput(inputHandler);

View File

@@ -24,7 +24,10 @@ namespace OpenRA.Server
readonly Action<Connection, int, int, byte[]> dispatchOrdersToClient;
readonly Action<Connection, string, Dictionary<string, object>> sendLocalizedMessageTo;
public PlayerMessageTracker(Server server, Action<Connection, int, int, byte[]> dispatchOrdersToClient, Action<Connection, string, Dictionary<string, object>> sendLocalizedMessageTo)
public PlayerMessageTracker(
Server server,
Action<Connection, int, int, byte[]> dispatchOrdersToClient,
Action<Connection, string, Dictionary<string, object>> sendLocalizedMessageTo)
{
this.server = server;
this.dispatchOrdersToClient = dispatchOrdersToClient;

View File

@@ -44,7 +44,11 @@ namespace OpenRA
Log.Write("exception", $"Date: {DateTime.UtcNow:u}");
Log.Write("exception", $"Operating System: {Platform.CurrentPlatform} ({Platform.CurrentArchitecture}, {Environment.OSVersion})");
Log.Write("exception", $"Runtime Version: {Platform.RuntimeVersion}");
Log.Write("exception", $"Installed Language: {CultureInfo.InstalledUICulture.TwoLetterISOLanguageName} (Installed) {CultureInfo.CurrentCulture.TwoLetterISOLanguageName} (Current) {CultureInfo.CurrentUICulture.TwoLetterISOLanguageName} (Current UI)");
Log.Write("exception",
"Installed Language: " +
$"{CultureInfo.InstalledUICulture.TwoLetterISOLanguageName} (Installed) " +
$"{CultureInfo.CurrentCulture.TwoLetterISOLanguageName} (Current) " +
$"{CultureInfo.CurrentUICulture.TwoLetterISOLanguageName} (Current UI)");
var rpt = BuildExceptionReport(ex).ToString();
Log.Write("exception", rpt);

View File

@@ -629,7 +629,8 @@ namespace OpenRA.Support
if (lastToken.RightOperand == token.LeftOperand)
{
if (lastToken.RightOperand)
throw new InvalidDataException($"Missing value or sub-expression or there is an extra operator `{lastToken.Symbol}` at index {lastToken.Index} or `{token.Symbol}` at index {token.Index}");
throw new InvalidDataException(
$"Missing value or sub-expression or there is an extra operator `{lastToken.Symbol}` at index {lastToken.Index} or `{token.Symbol}` at index {token.Index}");
throw new InvalidDataException($"Missing binary operation before `{token.Symbol}` at index {token.Index}");
}
}
@@ -736,7 +737,10 @@ namespace OpenRA.Support
return IfThenElse(expression, One, Zero);
}
throw new InvalidProgramException($"Unable to convert ExpressionType.{Enum<ExpressionType>.GetValues()[(int)fromType]} to ExpressionType.{Enum<ExpressionType>.GetValues()[(int)toType]}");
throw new InvalidProgramException(
"Unable to convert " +
$"ExpressionType.{Enum<ExpressionType>.GetValues()[(int)fromType]} to " +
$"ExpressionType.{Enum<ExpressionType>.GetValues()[(int)toType]}");
}
public Expression Pop(ExpressionType type)

View File

@@ -21,7 +21,8 @@ namespace OpenRA
/// <summary>
/// 1d world distance - 1024 units = 1 cell.
/// </summary>
public readonly struct WDist : IComparable, IComparable<WDist>, IEquatable<WDist>, IScriptBindable, ILuaAdditionBinding, ILuaSubtractionBinding, ILuaEqualityBinding, ILuaTableBinding
public readonly struct WDist : IComparable, IComparable<WDist>, IEquatable<WDist>,
IScriptBindable, ILuaAdditionBinding, ILuaSubtractionBinding, ILuaEqualityBinding, ILuaTableBinding
{
public readonly int Length;
public long LengthSquared => (long)Length * Length;