RCS0056 - roslynator_max_line_length = 160

This commit is contained in:
RoosterDragon
2024-07-27 16:09:46 +01:00
committed by Matthias Mailänder
parent 9d5d2ab493
commit 0649f3dc32
129 changed files with 606 additions and 245 deletions

View File

@@ -20,7 +20,8 @@ namespace OpenRA.Mods.Cnc.Graphics
public ClassicSpriteSequenceLoader(ModData modData)
: base(modData) { }
public override ISpriteSequence CreateSequence(ModData modData, string tileset, SpriteCache cache, string image, string sequence, MiniYaml data, MiniYaml defaults)
public override ISpriteSequence CreateSequence(
ModData modData, string tileset, SpriteCache cache, string image, string sequence, MiniYaml data, MiniYaml defaults)
{
return new ClassicSpriteSequence(cache, this, image, sequence, data, defaults);
}

View File

@@ -21,7 +21,8 @@ namespace OpenRA.Mods.Cnc.Graphics
public ClassicTilesetSpecificSpriteSequenceLoader(ModData modData)
: base(modData) { }
public override ISpriteSequence CreateSequence(ModData modData, string tileset, SpriteCache cache, string image, string sequence, MiniYaml data, MiniYaml defaults)
public override ISpriteSequence CreateSequence(
ModData modData, string tileset, SpriteCache cache, string image, string sequence, MiniYaml data, MiniYaml defaults)
{
return new ClassicTilesetSpecificSpriteSequence(cache, this, image, sequence, data, defaults);
}

View File

@@ -41,7 +41,11 @@ namespace OpenRA.Mods.Cnc.Graphics
readonly WVec cachedLength;
IEnumerable<IFinalizedRenderable> cache;
public TeslaZapRenderable(WPos pos, int zOffset, in WVec length, string image, string brightSequence, int brightZaps, string dimSequence, int dimZaps, string palette)
public TeslaZapRenderable(
WPos pos, int zOffset, in WVec length, string image,
string brightSequence, int brightZaps,
string dimSequence, int dimZaps,
string palette)
{
Pos = pos;
ZOffset = zOffset;
@@ -68,8 +72,10 @@ namespace OpenRA.Mods.Cnc.Graphics
return new TeslaZapRenderable(Pos, ZOffset, length, image, brightSequence, brightZaps, dimSequence, dimZaps, palette);
}
public IRenderable WithZOffset(int newOffset) { return new TeslaZapRenderable(Pos, ZOffset, length, image, brightSequence, brightZaps, dimSequence, dimZaps, palette); }
public IRenderable OffsetBy(in WVec vec) { return new TeslaZapRenderable(Pos + vec, ZOffset, length, image, brightSequence, brightZaps, dimSequence, dimZaps, palette); }
public IRenderable WithZOffset(int newOffset) =>
new TeslaZapRenderable(Pos, ZOffset, length, image, brightSequence, brightZaps, dimSequence, dimZaps, palette);
public IRenderable OffsetBy(in WVec vec) =>
new TeslaZapRenderable(Pos + vec, ZOffset, length, image, brightSequence, brightZaps, dimSequence, dimZaps, palette);
public IRenderable AsDecoration() { return this; }
public IFinalizedRenderable PrepareRender(WorldRenderer wr) { return this; }

View File

@@ -25,7 +25,9 @@ namespace OpenRA.Mods.Cnc.Installer
public void RunActionOnSource(MiniYaml actionYaml, string path, ModData modData, List<string> extracted, Action<string> updateMessage)
{
// Yaml path may be specified relative to a named directory (e.g. ^SupportDir) or the detected source path
var sourcePath = actionYaml.Value.StartsWith('^') ? Platform.ResolvePath(actionYaml.Value) : FS.ResolveCaseInsensitivePath(Path.Combine(path, actionYaml.Value));
var sourcePath = actionYaml.Value.StartsWith('^')
? Platform.ResolvePath(actionYaml.Value)
: FS.ResolveCaseInsensitivePath(Path.Combine(path, actionYaml.Value));
using (var source = File.OpenRead(sourcePath))
{

View File

@@ -78,7 +78,8 @@ namespace OpenRA.Mods.Cnc.Traits
void INotifyAttack.PreparingAttack(Actor self, in Target target, Armament a, Barrel barrel) { }
public override Activity GetAttackActivity(Actor self, AttackSource source, in Target newTarget, bool allowMove, bool forceAttack, Color? targetLineColor = null)
public override Activity GetAttackActivity(
Actor self, AttackSource source, in Target newTarget, bool allowMove, bool forceAttack, Color? targetLineColor = null)
{
return new ChargeAttack(this, newTarget, forceAttack, targetLineColor);
}

View File

@@ -102,7 +102,9 @@ namespace OpenRA.Mods.Cnc.Traits
{
get
{
yield return new TargetTypeOrderTargeter(new BitSet<TargetableType>("DetonateAttack"), "DetonateAttack", 5, info.AttackCursor, true, false) { ForceAttack = false };
yield return
new TargetTypeOrderTargeter(new BitSet<TargetableType>("DetonateAttack"), "DetonateAttack", 5, info.AttackCursor, true, false)
{ ForceAttack = false };
if (!initiated)
yield return new DeployOrderTargeter("Detonate", 5, () => info.DeployCursor);

View File

@@ -19,7 +19,8 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Traits.Render
{
public class WithVoxelBarrelInfo : ConditionalTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<ArmamentInfo>, Requires<TurretedInfo>
public class WithVoxelBarrelInfo : ConditionalTraitInfo,
IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<ArmamentInfo>, Requires<TurretedInfo>
{
[Desc("Voxel sequence name to use")]
public readonly string Sequence = "barrel";

View File

@@ -19,7 +19,8 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Traits.Render
{
public class WithVoxelWalkerBodyInfo : PausableConditionalTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<IMoveInfo>, Requires<IFacingInfo>
public class WithVoxelWalkerBodyInfo : PausableConditionalTraitInfo,
IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<IMoveInfo>, Requires<IFacingInfo>
{
public readonly string Sequence = "idle";

View File

@@ -209,7 +209,8 @@ namespace OpenRA.Mods.Cnc.Traits
var tiles = power.CellsMatching(xy, footprint, dimensions);
var palette = wr.Palette(((ChronoshiftPowerInfo)power.Info).TargetOverlayPalette);
foreach (var t in tiles)
yield return new SpriteRenderable(tile, wr.World.Map.CenterOfCell(t), WVec.Zero, -511, palette, 1f, alpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
yield return new SpriteRenderable(
tile, wr.World.Map.CenterOfCell(t), WVec.Zero, -511, palette, 1f, alpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
}
protected override string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi)
@@ -310,7 +311,8 @@ namespace OpenRA.Mods.Cnc.Traits
var isValid = manager.Self.Owner.Shroud.IsExplored(t + delta);
var tile = isValid ? validTile : invalidTile;
var alpha = isValid ? validAlpha : invalidAlpha;
yield return new SpriteRenderable(tile, wr.World.Map.CenterOfCell(t + delta), WVec.Zero, -511, palette, 1f, alpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
yield return new SpriteRenderable(
tile, wr.World.Map.CenterOfCell(t + delta), WVec.Zero, -511, palette, 1f, alpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
}
// Unit previews
@@ -323,7 +325,8 @@ namespace OpenRA.Mods.Cnc.Traits
unit.Trait<Chronoshiftable>().CanChronoshiftTo(unit, targetCell);
var tile = canEnter ? validTile : invalidTile;
var alpha = canEnter ? validAlpha : invalidAlpha;
yield return new SpriteRenderable(tile, wr.World.Map.CenterOfCell(targetCell), WVec.Zero, -511, palette, 1f, alpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
yield return new SpriteRenderable(
tile, wr.World.Map.CenterOfCell(targetCell), WVec.Zero, -511, palette, 1f, alpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
}
var offset = world.Map.CenterOfCell(xy) - world.Map.CenterOfCell(sourceLocation);
@@ -353,7 +356,8 @@ namespace OpenRA.Mods.Cnc.Traits
// Source tiles
foreach (var t in power.CellsMatching(sourceLocation, footprint, dimensions))
yield return new SpriteRenderable(sourceTile, wr.World.Map.CenterOfCell(t), WVec.Zero, -511, palette, 1f, sourceAlpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
yield return new SpriteRenderable(
sourceTile, wr.World.Map.CenterOfCell(t), WVec.Zero, -511, palette, 1f, sourceAlpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
}
bool IsValidTarget(CPos xy)

View File

@@ -47,7 +47,8 @@ namespace OpenRA.Mods.Cnc.Traits
bool IOccupySpaceInfo.SharesCell => false;
// Used to determine if actor can spawn
public bool CanEnterCell(World world, Actor self, CPos cell, SubCell subCell = SubCell.FullCell, Actor ignoreActor = null, BlockedByActor check = BlockedByActor.All)
public bool CanEnterCell(World world, Actor self, CPos cell,
SubCell subCell = SubCell.FullCell, Actor ignoreActor = null, BlockedByActor check = BlockedByActor.All)
{
return world.Map.Contains(cell);
}

View File

@@ -447,7 +447,8 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
}
}
protected virtual bool TryHandleOverlayToActorInner(CPos cell, byte[] overlayPack, CellLayer<int> overlayIndex, byte overlayType, out ActorReference actorReference)
protected virtual bool TryHandleOverlayToActorInner(
CPos cell, byte[] overlayPack, CellLayer<int> overlayIndex, byte overlayType, out ActorReference actorReference)
{
actorReference = null;
if (!OverlayToActor.TryGetValue(overlayType, out var actorType))

View File

@@ -267,7 +267,8 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
#region Method overrides
protected override bool TryHandleOverlayToActorInner(CPos cell, byte[] overlayPack, CellLayer<int> overlayIndex, byte overlayType, out ActorReference actorReference)
protected override bool TryHandleOverlayToActorInner(
CPos cell, byte[] overlayPack, CellLayer<int> overlayIndex, byte overlayType, out ActorReference actorReference)
{
actorReference = null;
if (!OverlayToActor.TryGetValue(overlayType, out var actorType))