Simplify 'default' expression (IDE0034)
This commit is contained in:
committed by
Matthias Mailänder
parent
02d9ba020d
commit
858d782af1
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
|
||||
public Teleport(Actor teleporter, CPos destination, int? maximumDistance,
|
||||
bool killCargo, bool screenFlash, string sound, bool interruptable = true,
|
||||
bool killOnFailure = false, BitSet<DamageType> killDamageTypes = default(BitSet<DamageType>))
|
||||
bool killOnFailure = false, BitSet<DamageType> killDamageTypes = default)
|
||||
{
|
||||
var max = teleporter.World.Map.Grid.MaximumTileSearchRange;
|
||||
if (maximumDistance > max)
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[FieldLoader.Require]
|
||||
[Desc("Uses the \"Cloneable\" trait to determine whether or not we should clone a produced unit.")]
|
||||
public readonly BitSet<CloneableType> CloneableTypes = default(BitSet<CloneableType>);
|
||||
public readonly BitSet<CloneableType> CloneableTypes = default;
|
||||
|
||||
[FieldLoader.Require]
|
||||
[Desc("e.g. Infantry, Vehicles, Aircraft, Buildings")]
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
[Desc("Types of damage that this trait causes to self when 'ExplodeInstead' is true",
|
||||
"or the return-to-origin is blocked. Leave empty for no damage types.")]
|
||||
public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>);
|
||||
public readonly BitSet<DamageType> DamageTypes = default;
|
||||
|
||||
public readonly string ChronoshiftSound = "chrono2.aud";
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[FieldLoader.Require]
|
||||
[Desc("This unit's cloneable type is:")]
|
||||
public readonly BitSet<CloneableType> Types = default(BitSet<CloneableType>);
|
||||
public readonly BitSet<CloneableType> Types = default;
|
||||
}
|
||||
|
||||
public class Cloneable { }
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly int Damage = 1000;
|
||||
|
||||
[Desc("Apply the damage using these damagetypes.")]
|
||||
public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>);
|
||||
public readonly BitSet<DamageType> DamageTypes = default;
|
||||
|
||||
[ConsumedConditionReference]
|
||||
[Desc("Boolean expression defining the condition under which to teleport a replacement actor instead of triggering the vortex.")]
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
class InfiltrateForCashInfo : TraitInfo
|
||||
{
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
public readonly BitSet<TargetableType> Types = default;
|
||||
|
||||
[Desc("Percentage of the victim's resources that will be stolen.")]
|
||||
public readonly int Percentage = 100;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
class InfiltrateForDecorationInfo : WithDecorationInfo
|
||||
{
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
public readonly BitSet<TargetableType> Types = default;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new InfiltrateForDecoration(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
class InfiltrateForExplorationInfo : TraitInfo
|
||||
{
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
public readonly BitSet<TargetableType> Types = default;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Sound the victim will hear when they get sabotaged.")]
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
class InfiltrateForPowerOutageInfo : TraitInfo
|
||||
{
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
public readonly BitSet<TargetableType> Types = default;
|
||||
|
||||
[Desc("Measured in ticks.")]
|
||||
public readonly int Duration = 500;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly string Proxy = null;
|
||||
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
public readonly BitSet<TargetableType> Types = default;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Sound the victim will hear when technology gets stolen.")]
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
class InfiltrateForSupportPowerResetInfo : TraitInfo
|
||||
{
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
public readonly BitSet<TargetableType> Types = default;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Sound the victim will hear when they get sabotaged.")]
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly bool SkipMakeAnims = true;
|
||||
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
public readonly BitSet<TargetableType> Types = default;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new InfiltrateForTransform(init, this); }
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public class InfiltratesInfo : ConditionalTraitInfo
|
||||
{
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
public readonly BitSet<TargetableType> Types = default;
|
||||
|
||||
[VoiceReference]
|
||||
public readonly string Voice = "Action";
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public WeaponInfo DetonationWeaponInfo { get; private set; }
|
||||
|
||||
[Desc("Types of damage that this trait causes to self while self-destructing. Leave empty for no damage types.")]
|
||||
public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>);
|
||||
public readonly BitSet<DamageType> DamageTypes = default;
|
||||
|
||||
[CursorReference]
|
||||
[Desc("Cursor to display when targeting.")]
|
||||
|
||||
@@ -17,10 +17,10 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
class MineInfo : TraitInfo
|
||||
{
|
||||
public readonly BitSet<CrushClass> CrushClasses = default(BitSet<CrushClass>);
|
||||
public readonly BitSet<CrushClass> CrushClasses = default;
|
||||
public readonly bool AvoidFriendly = true;
|
||||
public readonly bool BlockFriendly = true;
|
||||
public readonly BitSet<CrushClass> DetonateClasses = default(BitSet<CrushClass>);
|
||||
public readonly BitSet<CrushClass> DetonateClasses = default;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new Mine(this); }
|
||||
}
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
if (mobile != null && !info.DetonateClasses.Overlaps(mobile.Info.LocomotorInfo.Crushes))
|
||||
return;
|
||||
|
||||
self.Kill(crusher, mobile != null ? mobile.Info.LocomotorInfo.CrushDamageTypes : default(BitSet<DamageType>));
|
||||
self.Kill(crusher, mobile != null ? mobile.Info.LocomotorInfo.CrushDamageTypes : default);
|
||||
}
|
||||
|
||||
bool ICrushable.CrushableBy(Actor self, Actor crusher, BitSet<CrushClass> crushClasses)
|
||||
|
||||
Reference in New Issue
Block a user