Convert masses of HashSet<string> to BitSet<DamageType>
This commit is contained in:
@@ -16,6 +16,7 @@ using OpenRA.Activities;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.Common.Traits.Render;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Activities
|
||||
@@ -30,9 +31,9 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
WPos to;
|
||||
int ticks;
|
||||
WAngle angle;
|
||||
HashSet<string> damageTypes;
|
||||
BitSet<DamageType> damageTypes;
|
||||
|
||||
public Leap(Actor self, Actor target, Armament a, WDist speed, WAngle angle, HashSet<string> damageTypes)
|
||||
public Leap(Actor self, Actor target, Armament a, WDist speed, WAngle angle, BitSet<DamageType> damageTypes)
|
||||
{
|
||||
var targetMobile = target.TraitOrDefault<Mobile>();
|
||||
if (targetMobile == null)
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Cnc.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
@@ -26,7 +27,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly WAngle Angle = WAngle.FromDegrees(20);
|
||||
|
||||
[Desc("Types of damage that this trait causes. Leave empty for no damage types.")]
|
||||
public readonly HashSet<string> DamageTypes = new HashSet<string>();
|
||||
public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>);
|
||||
|
||||
public override object Create(ActorInitializer init) { return new AttackLeap(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using OpenRA.Mods.Cnc.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
@@ -25,7 +24,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly bool ExplodeInstead = false;
|
||||
|
||||
[Desc("Types of damage that this trait causes to self when 'ExplodeInstead' is true. Leave empty for no damage types.")]
|
||||
public readonly HashSet<string> DamageTypes = new HashSet<string>();
|
||||
public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>);
|
||||
|
||||
public readonly string ChronoshiftSound = "chrono2.aud";
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public readonly int Damage = 1000;
|
||||
|
||||
[Desc("Apply the damage using these damagetypes.")]
|
||||
public readonly HashSet<string> DamageTypes = new HashSet<string>();
|
||||
public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>);
|
||||
|
||||
[Desc("Actor to transform into when the timer expires during (un)deploy."), ActorReference]
|
||||
public readonly string OriginalActor = "mcv";
|
||||
|
||||
@@ -54,7 +54,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 HashSet<string> DamageTypes = new HashSet<string>();
|
||||
public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>);
|
||||
|
||||
public object Create(ActorInitializer init) { return new MadTank(init.Self, this); }
|
||||
public void RulesetLoaded(Ruleset rules, ActorInfo ai)
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
@@ -48,7 +49,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 : new HashSet<string>());
|
||||
self.Kill(crusher, mobile != null ? mobile.Info.LocomotorInfo.CrushDamageTypes : default(BitSet<DamageType>));
|
||||
}
|
||||
|
||||
bool ICrushable.CrushableBy(Actor self, Actor crusher, HashSet<string> crushClasses)
|
||||
|
||||
Reference in New Issue
Block a user