Convert crushclasses to bitset

This commit is contained in:
Chris Forbes
2018-07-28 12:50:51 -07:00
committed by Paul Chote
parent 82f6c2b862
commit 51e000599a
8 changed files with 31 additions and 28 deletions

View File

@@ -91,9 +91,9 @@ namespace OpenRA.Mods.Common.Traits
SetPosition(self, init.Get<LocationInit, CPos>());
}
void INotifyCrushed.WarnCrush(Actor self, Actor crusher, HashSet<string> crushClasses) { }
void INotifyCrushed.WarnCrush(Actor self, Actor crusher, BitSet<CrushClass> crushClasses) { }
void INotifyCrushed.OnCrush(Actor self, Actor crusher, HashSet<string> crushClasses)
void INotifyCrushed.OnCrush(Actor self, Actor crusher, BitSet<CrushClass> crushClasses)
{
// Crate can only be crushed if it is not in the air.
if (!self.IsAtGroundLevel() || !crushClasses.Contains(info.CrushClass))
@@ -216,7 +216,7 @@ namespace OpenRA.Mods.Common.Traits
return GetAvailableSubCell(a, SubCell.Any, ignoreActor, checkTransientActors) != SubCell.Invalid;
}
bool ICrushable.CrushableBy(Actor self, Actor crusher, HashSet<string> crushClasses)
bool ICrushable.CrushableBy(Actor self, Actor crusher, BitSet<CrushClass> crushClasses)
{
// Crate can only be crushed if it is not in the air.
return self.IsAtGroundLevel() && crushClasses.Contains(info.CrushClass);