Simplify 'default' expression (IDE0034)

This commit is contained in:
Gustas
2022-10-11 17:28:58 +03:00
committed by Matthias Mailänder
parent 02d9ba020d
commit 858d782af1
70 changed files with 90 additions and 88 deletions

View File

@@ -73,10 +73,10 @@ namespace OpenRA.Mods.Common.Traits
public readonly bool MoveIntoShroud = true;
[Desc("e.g. crate, wall, infantry")]
public readonly BitSet<CrushClass> Crushes = default(BitSet<CrushClass>);
public readonly BitSet<CrushClass> Crushes = default;
[Desc("Types of damage that are caused while crushing. Leave empty for no damage types.")]
public readonly BitSet<DamageType> CrushDamageTypes = default(BitSet<DamageType>);
public readonly BitSet<DamageType> CrushDamageTypes = default;
[FieldLoader.LoadUsing(nameof(LoadSpeeds), true)]
[Desc("Lower the value on rough terrain. Leave out entries for impassable terrain.")]
@@ -134,7 +134,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly LongBitSet<PlayerBitMask> Crushable;
public readonly CellFlag CellFlag;
public CellCache(LongBitSet<PlayerBitMask> immovable, CellFlag cellFlag, LongBitSet<PlayerBitMask> crushable = default(LongBitSet<PlayerBitMask>))
public CellCache(LongBitSet<PlayerBitMask> immovable, CellFlag cellFlag, LongBitSet<PlayerBitMask> crushable = default)
{
Immovable = immovable;
Crushable = crushable;
@@ -467,13 +467,13 @@ namespace OpenRA.Mods.Common.Traits
if (!actors.Any())
{
cache[cell] = new CellCache(default(LongBitSet<PlayerBitMask>), cellFlag);
cache[cell] = new CellCache(default, cellFlag);
return;
}
if (sharesCell && actorMap.HasFreeSubCell(cell))
{
cache[cell] = new CellCache(default(LongBitSet<PlayerBitMask>), cellFlag);
cache[cell] = new CellCache(default, cellFlag);
return;
}

View File

@@ -180,7 +180,7 @@ namespace OpenRA.Mods.Common.Traits
if (!world.Map.Contains(loc))
return;
var tile = dirty.ContainsKey(loc) ? dirty[loc] : default(Smudge);
var tile = dirty.ContainsKey(loc) ? dirty[loc] : default;
// Setting Sequence to null to indicate a deleted smudge.
tile.Sequence = null;