Fix IDE0001

This commit is contained in:
RoosterDragon
2023-02-19 09:54:24 +00:00
committed by Pavel Penev
parent ee35cbc0d0
commit 8b4500146f
5 changed files with 9 additions and 6 deletions

View File

@@ -126,6 +126,9 @@ dotnet_style_predefined_type_for_locals_parameters_members = true
# Show an IDE warning when default access modifiers are explicitly specified.
dotnet_style_require_accessibility_modifiers = omit_if_default:warning
# Simplify name.
dotnet_diagnostic.IDE0001.severity = warning
# use 'var' instead of explicit type
dotnet_diagnostic.IDE0007.severity = warning

View File

@@ -137,7 +137,7 @@ namespace OpenRA
IReadOnlyPackage mapPackage = null;
try
{
using (new Support.PerfTimer(map))
using (new PerfTimer(map))
{
mapPackage = package.OpenPackage(map, modData.ModFiles);
if (mapPackage != null)

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Traits
}
/// <summary>
/// Type tag for DamageTypes <see cref="Primitives.BitSet{T}"/>.
/// Type tag for DamageTypes <see cref="BitSet{T}"/>.
/// </summary>
public sealed class DamageType { DamageType() { } }
@@ -483,7 +483,7 @@ namespace OpenRA.Traits
}
/// <summary>
/// Indicates target types as defined on <see cref="Traits.ITargetable"/> are present in a <see cref="Primitives.BitSet{T}"/>.
/// Indicates target types as defined on <see cref="ITargetable"/> are present in a <see cref="BitSet{T}"/>.
/// </summary>
public sealed class TargetableType { TargetableType() { } }

View File

@@ -66,7 +66,7 @@ namespace OpenRA
// Add an additional quadratic variation to height
// Uses decimal to avoid integer overflow
var offset = (decimal)(b - a).Length * pitch.Tan() * mul * (div - mul) / (1024 * div * div);
var clampedOffset = (int)(offset + (decimal)ret.Z).Clamp<decimal>((decimal)int.MinValue, (decimal)int.MaxValue);
var clampedOffset = (int)(offset + (decimal)ret.Z).Clamp((decimal)int.MinValue, (decimal)int.MaxValue);
return new WPos(ret.X, ret.Y, clampedOffset);
}

View File

@@ -516,12 +516,12 @@ namespace OpenRA
public void ApplyToActorsWithTraitTimed<T>(Action<Actor, T> action, string text)
{
TraitDict.ApplyToActorsWithTraitTimed<T>(action, text);
TraitDict.ApplyToActorsWithTraitTimed(action, text);
}
public void ApplyToActorsWithTrait<T>(Action<Actor, T> action)
{
TraitDict.ApplyToActorsWithTrait<T>(action);
TraitDict.ApplyToActorsWithTrait(action);
}
public IEnumerable<Actor> ActorsHavingTrait<T>()